/* Premium UI/UX Design System for HARJITA CORP */

:root {
    /* Color Palette */
    --color-dark-bg: #111119;
    --color-charcoal: #1a1a2e;
    --color-gold: #D4AF37;
    --color-gold-dark: #aa8c2c;
    --color-gold-light: #F4E2A1;
    --color-cream: #FDFBF5;
    --color-text-light: #f8fafc;
    --color-text-dark: #1e293b;
    --color-accent: #2a2a4a;
    
    /* Gradients */
    --gradient-gold: linear-gradient(135deg, var(--color-gold-light) 0%, var(--color-gold) 50%, var(--color-gold-dark) 100%);
    --gradient-dark: linear-gradient(135deg, var(--color-dark-bg) 0%, var(--color-charcoal) 100%);
}

.bg-gradient-dark {
    background: var(--gradient-dark);
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Base Styles */
body {
    color: var(--color-text-dark);
    background-color: var(--color-cream);
    overflow-x: clip;
}

/* Premium text selection */
::selection {
    background: rgba(212, 175, 55, 0.25);
    color: var(--color-charcoal);
}
::-moz-selection {
    background: rgba(212, 175, 55, 0.25);
    color: var(--color-charcoal);
}

/* Focus-visible for accessibility */
a:focus-visible, button:focus-visible {
    outline: 2px solid var(--color-gold);
    outline-offset: 2px;
    border-radius: 4px;
}

h1, h2, h3, h4, h5, h6, .font-playfair {
    font-family: 'Playfair Display', serif;
}

/* Glassmorphism Utilities */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

.glass-dark {
    background: rgba(26, 26, 46, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(212, 175, 55, 0.2);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Premium Navbar */
nav {
    transition: background-color 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease, padding 0.4s ease !important;
    background: transparent !important;
    box-shadow: none !important;
    border-bottom: 1px solid transparent;
}

nav.scrolled {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

/* Dark Mode Variants for Navbar on Hero */
.nav-dark .max-w-7xl a:not(.btn-contact) {
    color: white !important;
}
.nav-dark.scrolled .max-w-7xl a:not(.btn-contact) {
    color: var(--color-text-dark) !important;
}
.nav-dark .nav-logo-text {
    color: white !important;
}
.nav-dark.scrolled .nav-logo-text {
    color: var(--color-charcoal) !important;
}
.nav-dark button#mobile-menu-btn {
    color: white !important;
}
.nav-dark.scrolled button#mobile-menu-btn {
    color: var(--color-charcoal) !important;
}

/* Mobile Menu — guaranteed readable text */
#mobile-menu {
    background: rgba(255, 255, 255, 0.98) !important;
}
#mobile-menu a {
    color: #4b5563 !important; /* gray-600 */
}
#mobile-menu a.text-primaryDark,
#mobile-menu a[class*="font-semibold"] {
    color: var(--color-gold-dark) !important;
}

/* Mobile Menu Animation */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.3s ease;
    opacity: 0;
}
#mobile-menu.open {
    max-height: 400px;
    opacity: 1;
}
/* Override Tailwind's hidden when using animated menu */
#mobile-menu.menu-animated {
    display: block !important;
}

/* Buttons */
.btn-gold {
    background: var(--gradient-gold);
    color: var(--color-charcoal) !important;
    border: none;
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: all 0.3s ease;
}

.btn-gold::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255,255,255,0.2);
    z-index: -2;
}

.btn-gold::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background-color: rgba(255,255,255,0.4);
    transition: all 0.3s ease;
    z-index: -1;
}

.btn-gold:hover::before {
    width: 100%;
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(212, 175, 55, 0.4);
}

/* Hardware Acceleration for Heavy Filters (Fixes Scroll Lag) */
.blur-3xl, .blur-2xl, .backdrop-blur-md, .backdrop-blur-lg {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* Hero Section */
.hero-premium {
    position: relative;
    background-position: center;
    background-size: cover;
}

/* Background attachment fixed causes scroll jank, removed for smoothness */

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(17, 17, 25, 0.3) 0%, rgba(17, 17, 25, 0.8) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

/* Premium Text Glow */
.text-glow {
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

.text-gradient {
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Decorative Backgrounds */
.bg-mesh {
    background-color: var(--color-cream);
    background-image: 
        radial-gradient(at 0% 0%, rgba(212, 175, 55, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(42, 42, 74, 0.05) 0px, transparent 50%);
}

.bg-dark-mesh {
    background-color: var(--color-dark-bg);
    background-image: 
        radial-gradient(at 0% 0%, rgba(212, 175, 55, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(42, 42, 74, 0.3) 0px, transparent 50%);
}

/* Premium Card */
.premium-card {
    background: white;
    border-radius: 20px;
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
}

.premium-card::after {
    content: "";
    border-radius: 20px;
    position: absolute;
    z-index: -1;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-shadow: 0 15px 40px -10px rgba(212, 175, 55, 0.2);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.premium-card:hover {
    transform: translateY(-8px);
    border-color: rgba(212, 175, 55, 0.3);
}

.premium-card:hover::after {
    opacity: 1;
}

/* Disable hover transforms on touch devices to prevent stuck states */
@media (hover: none) {
    .premium-card:hover {
        transform: none;
    }
}

/* Animations */
@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

@keyframes shine {
    100% { left: 125%; }
}

.animate-shine {
    animation: shine 1.5s ease-in-out infinite;
}

@keyframes pulse-glow {
    0% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(212, 175, 55, 0); }
    100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
}

.animate-pulse-glow {
    animation: pulse-glow 2s infinite;
}

/* Swiper overrides */
.swiper-button-next, .swiper-button-prev {
    color: var(--color-gold) !important;
}

.swiper-pagination-bullet-active {
    background: var(--color-gold) !important;
}

/* Mobile: smaller swiper nav buttons */
@media (max-width: 640px) {
    .swiper-button-next,
    .swiper-button-prev {
        width: 36px !important;
        height: 36px !important;
    }
    .swiper-button-next::after,
    .swiper-button-prev::after {
        font-size: 14px !important;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--color-cream);
}
::-webkit-scrollbar-thumb {
    background: var(--color-gold-dark);
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-gold);
}

/* ========================================
   MOBILE RESPONSIVE FIXES
   ======================================== */

/* --- Global Mobile Spacing --- */
@media (max-width: 640px) {
    /* Reduce section padding on mobile */
    .py-20 { padding-top: 3rem; padding-bottom: 3rem; }
    .py-24 { padding-top: 3.5rem; padding-bottom: 3.5rem; }
    .mb-16 { margin-bottom: 2.5rem; }
    .mb-20 { margin-bottom: 3rem; }
    .mb-24 { margin-bottom: 3rem; }
    
    /* Reduce card padding on mobile */
    .premium-card .p-10,
    .p-10 { padding: 1.5rem; }
    .p-14, .md\:p-14 { padding: 1.5rem; }
}

/* --- Footer Mobile --- */
@media (max-width: 768px) {
    footer .text-3xl {
        font-size: 1.5rem;
    }
}

/* --- About page stats overflow fix --- */
@media (max-width: 480px) {
    .stats-row {
        flex-direction: column;
        gap: 1.5rem;
    }
}

/* --- Admin Dashboard Mobile Tables --- */
@media (max-width: 1024px) {
    /* Smooth scrolling and obvious overflow */
    .overflow-x-auto {
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.5rem;
    }
    
    /* Make the action column sticky to the right */
    table th:last-child,
    table td:last-child {
        position: sticky !important;
        right: 0 !important;
        z-index: 10 !important;
        border-left: 1px solid #f3f4f6;
        box-shadow: -4px 0 10px rgba(0,0,0,0.02);
    }
    
    table th:last-child {
        background-color: #f9fafb !important; /* bg-gray-50 */
    }
    
    table tbody td:last-child {
        background-color: #ffffff !important;
    }
    
    table tbody tr:hover td:last-child {
        background-color: #f9fafb !important; /* hover:bg-gray-50 */
    }

    /* Force action buttons to be fully visible on mobile */
    table td:last-child > div {
        opacity: 1 !important;
    }
}

/* ========================================
   PERFORMANCE OPTIMIZATIONS
   ======================================== */

/* GPU-accelerated transforms for smoother animations (limited to avoid VRAM exhaustion) */
nav {
    will-change: transform;
}

/* content-visibility removed as it can cause scrollbar jumping and jank */

/* Optimize image rendering */
img {
    image-rendering: auto;
}

/* Smooth image loading fade-in */
img[loading="lazy"] {
    opacity: 1;
    transition: opacity 0.4s ease;
}

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

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .animate-float,
    .animate-pulse-glow,
    .animate-bounce,
    .animate-pulse,
    .animate-spin {
        animation: none !important;
    }
}

/* Fix for IG Badges Hover */
.ig-badge:hover {
    background: linear-gradient(to right, #D4AF37, #EAB308) !important;
}
.ig-badge:hover .ig-text-title {
    color: rgba(26, 26, 46, 0.7) !important;
}
.ig-badge:hover .ig-text-handle {
    color: #1a1a2e !important;
}
.ig-badge:hover .ig-icon-wrap {
    background-color: #ffffff !important;
    color: #D4AF37 !important;
}
