/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;900&family=Outfit:wght@300;400;500;700;900&family=Playfair+Display:ital,wght@0,400;0,700;1,400;1,700&family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

@tailwind base;
@tailwind components;
@tailwind utilities;

/* Custom Base Styles */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    width: 100%;
}

.max-w-7xl {
    width: 100%;
}

@media (max-width: 768px) {
    .px-6 {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', sans-serif;
}

/* Scrollbar Hide Utility */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* =========================================
   Animations
   ========================================= */

/* Float 3D Animation */
@keyframes float-3d {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(2deg);
    }
}

.animate-float-3d {
    animation: float-3d 6s ease-in-out infinite;
}

/* Glow Pulse */
@keyframes glow-pulse {

    0%,
    100% {
        opacity: 0.5;
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
    }

    50% {
        opacity: 0.8;
        box-shadow: 0 0 40px rgba(99, 102, 241, 0.6);
    }
}

.animate-glow-pulse {
    animation: glow-pulse 3s infinite;
}

/* Fade In Up */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

/* Slide Down */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slide-down {
    animation: slideDown 0.6s ease-out forwards;
}

/* Gradient X Animation */
@keyframes gradient-x {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.animate-gradient-x {
    background-size: 200% 200%;
    animation: gradient-x 5s ease infinite;
}

/* Slow Zoom */
@keyframes slowZoom {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.1);
    }
}

.animate-slow-zoom {
    animation: slowZoom 20s linear infinite alternate;
}

/* Typewriter Cursor */
.typewriter::after {
    content: '|';
    animation: blink 1s step-end infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* =========================================
   Specific Theme Elements
   ========================================= */

/* Hero Glow Effects */
.glow-neon-blue {
    text-shadow: 0 0 10px rgba(99, 102, 241, 0.5), 0 0 20px rgba(99, 102, 241, 0.3);
}

.glow-neon-blue-box {
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.glow-gold {
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.5), 0 0 20px rgba(245, 158, 11, 0.3);
}

.glow-gold-box {
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

/* Dark Black Glow Effect */
.glow-box {
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.9), 0 0 20px rgba(0, 0, 0, 0.5) !important;
    transition: box-shadow 0.3s ease;
}

.dark .glow-box {
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.9), 0 0 20px rgba(0, 0, 0, 0.5) !important;
}

.glow-box:hover {
    box-shadow: 0 15px 50px -10px rgba(0, 0, 0, 1), 0 0 30px rgba(0, 0, 0, 0.6) !important;
}

.dark .glow-box:hover {
    box-shadow: 0 15px 50px -10px rgba(0, 0, 0, 1), 0 0 30px rgba(0, 0, 0, 0.6) !important;
}

/* Global Black Shadow Utility */
.global-black-shadow {
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.8) !important;
    transition: box-shadow 0.3s ease;
}

.dark .global-black-shadow {
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.9) !important;
}

.global-black-shadow:hover {
    box-shadow: 0 15px 40px -5px rgba(0, 0, 0, 0.9) !important;
}

.glow-red {
    box-shadow: 0 0 15px rgba(244, 63, 94, 0.5);
}

/* Glassmorphism Card */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.dark .glass-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Image Glow Hover */
.image-glow {
    transition: filter 0.3s ease;
}

.image-glow:hover {
    filter: drop-shadow(0 0 15px rgba(99, 102, 241, 0.5));
}

/* Pop Click Effect */
.pop-click {
    animation: pop 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(0.95);
    }

    100% {
        transform: scale(1);
    }
}

/* Background Patterns */
.bg-home-v1 {
    background-image: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.05) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(244, 63, 94, 0.05) 0%, transparent 20%);
}

.dark .bg-home-v1 {
    background-image: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(244, 63, 94, 0.1) 0%, transparent 20%);
}

.brand-glow:hover {
    filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.6));
}

/* Active Navigation Link - Underline Effect */
.active-nav-link {
    position: relative;
    color: #6366f1;
    /* Indigo-600 - Brand Color */
    font-weight: 700;
}

.active-nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 100%;
    height: 2px;
    background-color: #6366f1;
    transform: scaleX(1);
    transform-origin: center;
    transition: transform 0.3s ease;
}

/* Premium Login Button */
.btn-login {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.1), 0 2px 4px -1px rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-login:hover {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.2), 0 4px 6px -2px rgba(16, 185, 129, 0.1);
}

/* RTL Utilities */
[dir="rtl"] .-translate-x-full {
    transform: translateX(100%);
}

[dir="rtl"] .translate-x-0 {
    transform: translateX(0);
}

[dir="rtl"] .start-0 {
    right: 0 !important;
    left: auto !important;
}

[dir="rtl"] .end-0 {
    left: 0 !important;
    right: auto !important;
}

[dir="rtl"] .ml-64,
[dir="rtl"] .lg\:ml-64 {
    margin-right: 16rem !important;
    margin-left: 0 !important;
}

[dir="rtl"] .ml-72,
[dir="rtl"] .lg\:ml-72 {
    margin-right: 18rem !important;
    margin-left: 0 !important;
}

/* DASHBOARD LAYOUT OVERRIDE (Robust RTL Support) */
@media (min-width: 1024px) {
    .dashboard-main {
        margin-inline-start: 19rem !important;
        /* 76 (19rem) > 64 (16rem sidebar) */
        transition: margin 0.3s ease;
        max-width: 100%;
        /* Ensure it does not overflow */
    }
}

/* Sidebar RTL Logic */
.sidebar-rtl {
    transform: translateX(100%);
    /* Start hidden on right for mobile */
    right: 0;
    left: auto;
}

@media (min-width: 1024px) {
    .sidebar-rtl {
        transform: translateX(0);
        /* Visible on desktop */
    }
}

/* Force start-0 behavior for fixed elements in RTL */
[dir="rtl"] .start-0 {
    right: 0 !important;
    left: auto !important;
}

/* --- Mobile Navigation RTL Support --- */
.mobile-menu-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 20rem;
    /* 80% max-w-xs approx 20rem */
    max-width: 80%;
    background-color: white;
    z-index: 200;
    transition: transform 0.3s ease-in-out;
    /* LTR Default */
    left: 0;
    right: auto;
    transform: translateX(-100%);
}

.dark .mobile-menu-drawer {
    background-color: #020617;
    /* Slate 950 */
}

.mobile-menu-drawer.open {
    transform: translateX(0);
}

/* RTL Overrides for Mobile Menu */
[dir="rtl"] .mobile-menu-drawer {
    left: auto;
    right: 0;
    transform: translateX(100%);
}

[dir="rtl"] .mobile-menu-drawer.open {
    transform: translateX(0);
}

.mobile-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 190;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out;
}

.mobile-overlay.open {
    opacity: 1;
    visibility: visible;
}