/* Custom styles for Kalla Amerta Nusantara */

/* ===== 60-30-10 COLOR RULE IMPLEMENTATION ===== */
/* 60% Dominant - Background & Large Elements */
:root {
  /* Professional Corporate Color System */
  --color-primary: #8B4513;       /* 60% - Rich Brown (Headings, Primary) */
  --color-secondary: #16a34a;     /* 30% - Professional Green (Accents) */
  --color-accent: #ea580c;        /* 10% - Corporate Orange (CTAs) */
  --color-dominant: #374151;      /* 60% - Charcoal (Authority & Trust) */

  /* Supporting Colors */
  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  --color-gray-800: #1f2937;
  --color-gray-900: #111827;

  /* Color Variations */
  --color-primary-light: #a16207;
  --color-secondary-light: #22c55e;
  --color-accent-light: #fb923c;
  --color-accent-dark: #c2410c;
  --color-dominant-light: #4B5563;
  --color-secondary-dark: #15803d;
}

/* ===== PROFESSIONAL BUTTON SYSTEM ===== */

/* Base Button Styles */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25rem;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Remove default button styles */
.btn:focus {
  outline: none;
}

/* Primary CTA Buttons (10% Accent - High Impact) */
.btn-primary {
  background: var(--color-accent);
  color: var(--color-dominant);
  border-color: var(--color-accent);
}

.btn-primary:hover {
  background: var(--color-accent-dark);
  border-color: var(--color-accent-dark);
}

/* Secondary Buttons (30% Secondary - Supporting Actions) */
.btn-secondary {
  background: var(--color-secondary);
  color: white;
  border-color: var(--color-secondary);
}

.btn-secondary:hover {
  background: var(--color-secondary-dark);
  border-color: var(--color-secondary-dark);
}

/* Ghost Buttons (60% Dominant - Subtle Actions) */
.btn-ghost {
  background: transparent;
  color: var(--color-secondary);
  border-color: var(--color-secondary);
}

.btn-ghost:hover {
  background: var(--color-secondary);
  color: var(--color-dominant);
}

/* Success State */
.btn-success {
  background: var(--color-secondary);
  color: var(--color-dominant);
  border-color: var(--color-secondary);
}

/* Error State */
.btn-error {
  background: #dc2626;
  color: white;
  border-color: #dc2626;
}

/* Loading State */
.btn-loading {
  background: var(--color-accent);
  color: var(--color-dominant);
  pointer-events: none;
}

.btn-loading::before {
  content: '';
  width: 1rem;
  height: 1rem;
  border: 2px solid transparent;
  border-top: 2px solid var(--color-dominant);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* ===== PROFESSIONAL ANIMATIONS ===== */

/* Simple focus effect for accessibility */
.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ===== KEYFRAME ANIMATIONS ===== */

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

@keyframes success-pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 139, 34, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(34, 139, 34, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 139, 34, 0); }
}

/* ===== RESPONSIVE BUTTON SIZES ===== */

@media (max-width: 640px) {
  .btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
  }
}

/* ===== ACCESSIBILITY ENHANCEMENTS ===== */

.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .btn {
    border-width: 3px;
  }

  .btn-primary {
    background: var(--color-accent);
    border-color: var(--color-primary);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .btn {
    transition: none;
  }

  .btn-loading {
    animation: none;
  }

  .btn-glow::after {
    animation: none;
  }
}

/* ===== SPECIALIZED BUTTON VARIANTS ===== */

/* Icon Buttons */
.btn-icon {
  width: 3rem;
  height: 3rem;
  padding: 0;
  border-radius: 50%;
}

.btn-icon i {
  font-size: 1.125rem;
}

/* Floating Action Button */
.btn-fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  z-index: 1000;
}

.btn-fab:hover {
  transform: scale(1.1);
}

/* ===== FORM BUTTONS ===== */

.btn-submit {
  width: 100%;
  justify-content: center;
  background: var(--color-dominant);
  color: white;
  border: 2px solid var(--color-secondary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1rem 2rem;
  font-size: 1.125rem;
  box-shadow: 0 4px 20px rgba(55, 65, 81, 0.3);
  position: relative;
  overflow: hidden;
}

.btn-submit::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(249, 115, 22, 0.2), transparent);
  transition: left 0.5s;
}

.btn-submit:hover::before {
  left: 100%;
}

.btn-submit:hover {
  background: var(--color-dominant-light);
  border-color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(55, 65, 81, 0.4);
}

/* ===== NAVIGATION BUTTONS ===== */

.nav-btn {
  background: transparent;
  color: var(--color-secondary);
  border: none;
  padding: 0.5rem 1rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  color: var(--color-accent);
  background: rgba(255, 165, 0, 0.1);
}

/* ===== ACCORDION BUTTONS - PRELINE UI STYLE ===== */

.accordion-btn {
  width: 100%;
  justify-content: space-between;
  background: white;
  color: var(--color-gray-800);
  border: 1px solid var(--color-gray-200);
  border-radius: 0.75rem;
  padding: 1rem 1.5rem;
  text-align: left;
  font-weight: 500;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.accordion-btn:hover {
  background: rgba(34, 139, 34, 0.05);
  border-color: var(--color-secondary);
}

.accordion-btn:focus {
  background: rgba(255, 165, 0, 0.1);
  border-color: var(--color-accent);
}

/* ===== HERO BUTTONS ===== */

/* Enhanced Primary CTA - Authority & Trust */
.btn-hero-primary {
  background: var(--color-dominant);
  color: white;
  border: 3px solid var(--color-secondary);
  padding: 1rem 2rem;
  font-size: 1.125rem;
  font-weight: 700;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(55, 65, 81, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: relative;
  overflow: hidden;
}

.btn-hero-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(249, 115, 22, 0.2), transparent);
  transition: left 0.5s;
}

.btn-hero-primary:hover::before {
  left: 100%;
}

.btn-hero-primary:hover {
  background: var(--color-dominant-light);
  border-color: var(--color-accent);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(55, 65, 81, 0.4);
}

.btn-hero-secondary {
  background: var(--color-secondary);
  color: white;
  border: 2px solid var(--color-secondary);
  padding: 0.875rem 1.75rem;
  font-weight: 600;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(234, 88, 12, 0.3);
}

.btn-hero-secondary:hover {
  background: var(--color-secondary-dark);
  border-color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(234, 88, 12, 0.4);
}

.accordion-icon {
  transition: transform 0.3s ease;
}

.accordion-btn[aria-expanded="true"] .accordion-icon {
  transform: rotate(180deg);
}

/* Tailwind CSS is loaded via CDN in HTML */

/* Removed duplicate color definitions - using main color system above */

/* Custom animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Custom Mobile Drawer Styles */
.mobile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    height: 100vh;
    background: white;
    z-index: 50;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    border-left: 1px solid #e5e7eb;
    overflow-y: auto;
}

.mobile-drawer.translate-x-0 {
    transform: translateX(0);
}

@media (max-width: 640px) {
    .mobile-drawer {
        width: 100vw;
    }
}

/* Drawer backdrop */
#drawer-backdrop {
    background: rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s ease-in-out;
}

#drawer-backdrop.hidden {
    opacity: 0;
    pointer-events: none;
}

#drawer-backdrop:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--dominant);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}

/* Focus styles for accessibility */
button:focus,
a:focus,
input:focus,
textarea:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary: #000000;
        --secondary: #000000;
        --accent: #FFFF00;
        --dominant: #FFFFFF;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Mobile responsive fix for hero background */
@media (max-width: 768px) {
    .hero-bg {
        background-attachment: scroll !important;
    }
}

/* Enhanced JavaScript features */
.navbar-scrolled {
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
    transition: all 0.3s ease;
}

/* Form validation styles */
.form-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-success {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
}

.error-message::before {
    content: "⚠";
    margin-right: 0.5rem;
}

/* Enhanced notification styles */
.notification {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading states */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: button-loading-spinner 1s ease infinite;
}

@keyframes button-loading-spinner {
    from {
        transform: rotate(0turn);
    }
    to {
        transform: rotate(1turn);
    }
}

/* Scroll indicator */
.scroll-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #8B4513, #228B22);
    z-index: 9999;
    transition: width 0.25s;
}

/* PWA install button (if added) */
.pwa-install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1f2937;
    color: white;
    padding: 1rem;
    text-align: center;
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.pwa-install-banner.show {
    transform: translateY(0);
}

/* Performance optimizations */
.hero-image-optimized {
    content-visibility: auto;
    contain-intrinsic-size: 0 600px;
}

/* Enhanced accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus visible improvements */
.focus-visible:focus-visible {
    outline: 2px solid #8B4513;
    outline-offset: 2px;
}

/* Line clamp utility */
.line-clamp-3 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .notification,
    .scroll-indicator,
    .btn-loading::after {
        animation: none !important;
        transition: none !important;
    }
}
