/**
 * Genius - Tema Principal
 * Réplica fiel do sistema original (Tailwind/React)
 * Cores baseadas em OKLCH convertidas para HEX/RGB
 */

:root {
    /* ==========================================
       Bootstrap CSS Variables Override
       ========================================== */
    --bs-primary: #009639;
    --bs-primary-rgb: 0, 150, 57;
    --bs-link-color: #009639;
    --bs-link-color-rgb: 0, 150, 57;
    --bs-link-hover-color: #007A2E;
    --bs-link-hover-color-rgb: 0, 122, 46;

    /* ==========================================
       Custom Theme Variables
       ========================================== */
    /* Primary: Verde Moçambique */
    --primary: #009639;
    --primary-hover: #007A2E;
    --primary-foreground: #FFFFFF;
    --primary-light: rgba(0, 150, 57, 0.1);
    --primary-shadow: rgba(0, 150, 57, 0.3);

    /* Accent: Verde escuro */
    --accent: #007A2E;
    --accent-foreground: #FFFFFF;

    /* Gold accent: Dourado Moçambique */
    --gold: #D4A017;
    --gold-light: rgba(212, 160, 23, 0.15);

    /* Background */
    --background: #FAFAFA;
    --foreground: #1A1A2E;

    /* Card */
    --card: #FFFFFF;
    --card-foreground: #1A1A2E;

    /* Secondary */
    --secondary: #F1F5F9;
    --secondary-foreground: #334155;

    /* Muted */
    --muted: #E2E8F0;
    --muted-foreground: #64748B;

    /* Border */
    --border: #E2E8F0;
    --input: #E2E8F0;
    --ring: #009639;

    /* Destructive */
    --destructive: #EF4444;
    --destructive-foreground: #FFFFFF;

    /* Sidebar */
    --sidebar: #FFFFFF;
    --sidebar-foreground: #334155;
    --sidebar-border: #E2E8F0;

    /* Radius */
    --radius: 0.75rem;
    --radius-sm: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-2xl: 2rem;
    --radius-full: 9999px;

    /* Gray Scale (Tailwind) */
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;

    /* Green Scale (Primary variations - Moçambique) */
    --green-50: #F0FFF4;
    --green-100: #C6F6D5;
    --green-200: #9AE6B4;
    --green-300: #68D391;
    --green-400: #48BB78;
    --green-500: #009639;
    --green-600: #007A2E;
    --green-700: #006325;
    --green-800: #004D1C;
    --green-900: #003814;

    /* Mode Colors */
    --mode-quick-doubt-bg: #FEF3C7;
    --mode-quick-doubt-text: #B45309;
    --mode-quick-doubt-border: #FDE68A;
    --mode-quick-doubt-gradient: linear-gradient(135deg, #F59E0B, #F97316);

    --mode-exam-prep-bg: #DBEAFE;
    --mode-exam-prep-text: #1D4ED8;
    --mode-exam-prep-border: #BFDBFE;
    --mode-exam-prep-gradient: linear-gradient(135deg, #3B82F6, #6366F1);

    --mode-revision-bg: #D1FAE5;
    --mode-revision-text: #047857;
    --mode-revision-border: #A7F3D0;
    --mode-revision-gradient: linear-gradient(135deg, #10B981, #009639);

    --mode-free-learning-bg: #F3E8FF;
    --mode-free-learning-text: #7C3AED;
    --mode-free-learning-border: #DDD6FE;
    --mode-free-learning-gradient: linear-gradient(135deg, #8B5CF6, #EC4899);
}

/* Dark theme */
.dark {
    --primary: #009639;
    --primary-foreground: #FFFFFF;
    --background: #0F172A;
    --foreground: #F8FAFC;
    --card: #1E293B;
    --card-foreground: #F8FAFC;
    --secondary: #334155;
    --secondary-foreground: #F8FAFC;
    --muted: #334155;
    --muted-foreground: #94A3B8;
    --border: #334155;
    --input: #334155;
    --sidebar: #1E293B;
    --sidebar-foreground: #F8FAFC;
    --sidebar-border: #334155;
}

/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--foreground);
    background-color: var(--background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Headings - Playfair Display */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    line-height: 1.3;
}

/* Links - Base styles (will be overridden by Bootstrap classes) */
a {
    color: #009639;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #007A2E;
}

/* Prevent horizontal overflow */
html,
body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Mobile scrollbar hiding */
@media (max-width: 1023px) {
    ::-webkit-scrollbar {
        display: none;
    }

    * {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    body {
        overscroll-behavior-y: contain;
    }
}

/* Touch feedback */
@media (hover: none) and (pointer: coarse) {

    button,
    a,
    [role="button"] {
        -webkit-tap-highlight-color: transparent;
    }
}

/* Custom scrollbar for desktop */
@media (min-width: 1024px) {
    ::-webkit-scrollbar {
        width: 12px;
        height: 12px;
    }

    ::-webkit-scrollbar-track {
        background: #F3F4F6;
        border-radius: 6px;
    }

    ::-webkit-scrollbar-thumb {
        background: #D1D5DB;
        border-radius: 6px;
        border: 2px solid #F3F4F6;
    }

    ::-webkit-scrollbar-thumb:hover {
        background: #9CA3AF;
    }
}

/* Firefox scrollbar */
* {
    scrollbar-width: auto;
    scrollbar-color: #D1D5DB #F3F4F6;
}

/* ==========================================
   Bootstrap Overrides & Custom Styles
   ========================================== */

/* 
 * IMPORTANT: These overrides ensure our custom teal color (#009639) 
 * takes precedence over Bootstrap's default blue primary color.
 * Bootstrap uses --bs-primary-rgb which we override in :root above.
 * Using high specificity selectors to override Bootstrap's !important
 */

/* Primary color - Force override Bootstrap's .text-primary */
.text-primary,
span.text-primary,
a.text-primary,
p.text-primary,
h1 .text-primary,
h2 .text-primary,
h3 .text-primary,
h4 .text-primary,
h5 .text-primary,
h6 .text-primary,
div .text-primary,
i.text-primary,
.bi.text-primary,
[class*="text-primary"] {
    --bs-text-opacity: 1;
    color: #009639 !important;
}

/* Background primary */
.bg-primary,
div.bg-primary,
span.bg-primary,
[class*="bg-primary"] {
    --bs-bg-opacity: 1;
    background-color: #009639 !important;
}

/* Border primary */
.border-primary,
div.border-primary,
.card.border-primary,
[class*="border-primary"] {
    --bs-border-opacity: 1;
    border-color: #009639 !important;
}

/* Links */
a {
    color: #009639;
}

a:hover {
    color: #007A2E;
}

/* Bootstrap link classes */
.link-primary,
a.link-primary {
    color: #009639 !important;
}

.link-primary:hover,
.link-primary:focus,
a.link-primary:hover,
a.link-primary:focus {
    color: #007A2E !important;
}

/* Text colors matching Tailwind */
.text-gray-300 {
    color: #D1D5DB !important;
}

.text-gray-400 {
    color: #9CA3AF !important;
}

.text-gray-500 {
    color: #6B7280 !important;
}

.text-gray-600 {
    color: #4B5563 !important;
}

.text-gray-700 {
    color: #374151 !important;
}

.text-gray-800 {
    color: #1F2937 !important;
}

.text-gray-900 {
    color: #111827 !important;
}

/* Background colors */
.bg-gray-50 {
    background-color: #F9FAFB !important;
}

.bg-gray-100 {
    background-color: #F3F4F6 !important;
}

.bg-gray-800 {
    background-color: #1F2937 !important;
}

.bg-gray-900 {
    background-color: #111827 !important;
}

.bg-black {
    background-color: #000000 !important;
}

/* Button styling - Primary */
.btn-primary,
.btn-primary.btn-primary {
    --bs-btn-bg: #009639;
    --bs-btn-border-color: #009639;
    --bs-btn-hover-bg: #007A2E;
    --bs-btn-hover-border-color: #007A2E;
    --bs-btn-active-bg: #006325;
    --bs-btn-active-border-color: #006325;
    --bs-btn-disabled-bg: #009639;
    --bs-btn-disabled-border-color: #009639;
    background-color: #009639 !important;
    border-color: #009639 !important;
    color: white !important;
    box-shadow: 0 10px 25px rgba(0, 150, 57, 0.3);
    transition: all 0.2s ease;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary.btn-primary:hover,
.btn-primary.btn-primary:focus {
    background-color: #007A2E !important;
    border-color: #007A2E !important;
    color: white !important;
    box-shadow: 0 15px 30px rgba(0, 150, 57, 0.3);
}

.btn-primary:active,
.btn-primary.btn-primary:active {
    background-color: #006325 !important;
    border-color: #006325 !important;
}

/* Button styling - Outline Primary */
.btn-outline-primary,
.btn-outline-primary.btn-outline-primary {
    --bs-btn-color: #009639;
    --bs-btn-border-color: #009639;
    --bs-btn-hover-bg: #009639;
    --bs-btn-hover-border-color: #009639;
    --bs-btn-active-bg: #007A2E;
    --bs-btn-active-border-color: #007A2E;
    color: #009639 !important;
    border-color: #009639 !important;
    background-color: transparent !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary.btn-outline-primary:hover,
.btn-outline-primary.btn-outline-primary:focus {
    background-color: #009639 !important;
    border-color: #009639 !important;
    color: white !important;
}

/* Button styling - Outline Secondary (gray border) */
.btn-outline-secondary {
    color: #374151 !important;
    border-color: #D1D5DB !important;
    background-color: transparent !important;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    background-color: #F3F4F6 !important;
    border-color: #9CA3AF !important;
    color: #111827 !important;
}

/* Button styling - Light (white background) */
.btn-light {
    background-color: white !important;
    border-color: white !important;
    color: #009639 !important;
}

.btn-light:hover,
.btn-light:focus {
    background-color: #F3F4F6 !important;
    border-color: #F3F4F6 !important;
    color: #009639 !important;
}

/* Button sizes */
.btn {
    border-radius: var(--radius);
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* Card styling */
.card {
    border-radius: var(--radius-lg);
    border-color: var(--border);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.card:hover {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.card.shadow-sm {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card.shadow-sm:hover {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* Card with primary border (popular plan) */
.card.border-primary {
    border-color: #009639 !important;
    box-shadow: 0 10px 40px rgba(0, 150, 57, 0.2);
}

/* Navbar styling */
.navbar {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.navbar-brand img {
    transition: transform 0.2s ease;
}

.navbar-brand img:hover {
    transform: scale(1.05);
}

.nav-link {
    font-weight: 500;
    color: #374151 !important;
    transition: color 0.2s ease, background-color 0.2s ease;
    border-radius: var(--radius);
    padding: 0.5rem 1rem !important;
}

.nav-link:hover {
    color: #009639 !important;
    background-color: rgba(0, 150, 57, 0.05);
}

.nav-link.active,
.nav-link.text-primary {
    color: #009639 !important;
}

/* Footer link hover */
.hover-primary:hover {
    color: #009639 !important;
}

/* Display headings with Inter font for better readability */
.display-1,
.display-2,
.display-3,
.display-4,
.display-5,
.display-6 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 700;
    color: #111827;
}

/* Lead text */
.lead {
    color: #4B5563;
}

/* Text muted - use gray-600 like Tailwind */
.text-muted {
    color: #4B5563 !important;
}

/* Text secondary - use gray-500 */
.text-secondary {
    color: #6B7280 !important;
}

/* Smooth transitions */
.card,
.btn,
a {
    transition: all 0.2s ease;
}

/* Avatar circle */
.avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 150, 57, 0.1);
    color: #009639;
    font-weight: 600;
    font-size: 14px;
}

/* Form controls */
.form-control,
.form-select {
    border-color: #E2E8F0;
    border-radius: var(--radius);
}

.form-control:focus,
.form-select:focus {
    border-color: #009639;
    box-shadow: 0 0 0 0.2rem rgba(0, 150, 57, 0.25);
}

/* Dropdown menu */
.dropdown-menu {
    border-radius: var(--radius);
    border: 1px solid #E2E8F0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.dropdown-item {
    color: #374151;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: rgba(0, 150, 57, 0.1);
    color: #009639;
}

/* Badge */
.badge {
    font-weight: 500;
}

.badge.bg-primary {
    background-color: #009639 !important;
}

/* Accordion */
.accordion-button {
    color: #111827;
}

.accordion-button:not(.collapsed) {
    background-color: rgba(0, 150, 57, 0.1);
    color: #009639;
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 150, 57, 0.25);
    border-color: #009639;
}

/* Icon colors */
.bi.text-primary {
    color: #009639 !important;
}

/* Gradient backgrounds */
.bg-gradient-primary {
    background: linear-gradient(135deg, #009639, #007A2E) !important;
}

/* Shadow utilities */
.shadow-primary {
    box-shadow: 0 10px 25px rgba(0, 150, 57, 0.3) !important;
}

/* Border radius utilities */
.rounded-2xl {
    border-radius: var(--radius-xl) !important;
}

.rounded-3xl {
    border-radius: var(--radius-2xl) !important;
}

/* Opacity utilities */
.opacity-75 {
    opacity: 0.75 !important;
}

.opacity-90 {
    opacity: 0.9 !important;
}

/* Gap utilities for flexbox */
.gap-1 {
    gap: 0.25rem !important;
}

.gap-2 {
    gap: 0.5rem !important;
}

.gap-3 {
    gap: 0.75rem !important;
}

.gap-4 {
    gap: 1rem !important;
}

.gap-5 {
    gap: 1.25rem !important;
}

/* Icon container styling */
.icon-container {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 150, 57, 0.1);
}

.icon-container i,
.icon-container svg {
    color: #009639;
}

/* CTA Section gradient */
.cta-gradient {
    background: linear-gradient(135deg, #009639, #007A2E);
}

/* Footer styling */
footer {
    background-color: white;
    border-top: 1px solid #E2E8F0;
}

footer a {
    color: #4B5563;
    transition: color 0.2s ease;
}

footer a:hover {
    color: #009639;
}

/* Popular badge styling */
.badge-popular {
    background: linear-gradient(135deg, #009639, #007A2E);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

/* Check/X icons in plan features */
.bi-check-lg.text-primary {
    color: #009639 !important;
}

.bi-x-lg.text-muted {
    color: #9CA3AF !important;
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .display-4 {
        font-size: 2rem;
    }

    .display-5 {
        font-size: 1.75rem;
    }

    .display-6 {
        font-size: 1.5rem;
    }

    .lead {
        font-size: 1rem;
    }
}

/* ==========================================
   Auth OAuth (Google)
   ========================================== */

.auth-separator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem 0;
}

.auth-separator-line {
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-separator-text {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted-foreground);
    font-weight: 600;
}

.auth-social {
    margin-bottom: 0.25rem;
}


.auth-google-shell:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 150, 57, 0.15);
}

.auth-google-shell.is-loading {
    opacity: 0.6;
    pointer-events: none;
}

.auth-google-missing {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    text-align: center;
    margin-top: 0.5rem;
}

@keyframes lucide-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.lucide-spin {
    animation: lucide-spin 1.5s linear infinite;
}