/* ============================================
   VritraAI Documentation Website - Common Styles
   Navigation, Footer, Header, Theme, Base
   ============================================ */

/* CSS Variables for Theme Support */
:root {
    /* Dark Theme (Default) - Professional Green */
    --bg-primary: #0a0f0a;
    --bg-secondary: #0f1510;
    --bg-tertiary: #1a2118;
    --bg-card: #141b14;
    --bg-hover: #1e261e;
    --bg-elevated: #182018;
    
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-tertiary: #9ca3af;
    --text-muted: #6b7280;
    
    --accent-primary: #22c55e;
    --accent-secondary: #16a34a;
    --accent-hover: #15803d;
    --accent-light: #4ade80;
    
    --border-color: #1e2e1e;
    --border-hover: #2a3a2a;
    --border-light: #243024;
    
    --code-bg: #0d1117;
    --code-text: #4ade80;
    --code-border: #1e2e1e;
    --code-accent: #22c55e;
    
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #22c55e;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.7);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    
    --gradient-primary: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    --gradient-secondary: linear-gradient(135deg, #182018 0%, #0a0f0a 100%);
}

/* Light Theme - Clean & Modern */
.light-theme {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-hover: #f1f5f9;
    --bg-elevated: #ffffff;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #64748b;
    --text-muted: #94a3b8;
    
    --accent-primary: #2563eb;
    --accent-secondary: #4f46e5;
    --accent-hover: #1d4ed8;
    --accent-light: #3b82f6;
    
    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;
    --border-light: #f1f5f9;
    
    --code-bg: #1e293b;
    --code-text: #a5d6ff;
    --code-border: #334155;
    --code-accent: #60a5fa;
    
    --success: #059669;
    --warning: #d97706;
    --error: #dc2626;
    --info: #0284c7;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    
    --gradient-primary: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    --gradient-secondary: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* SVG Icon Styles */
svg {
    width: 1em;
    height: 1em;
    display: inline-block;
    vertical-align: middle;
    fill: none;
    stroke: currentColor;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(20px) saturate(180%);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    border-radius: 0;
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 0;
    width: 100%;
}

/* Desktop: Remove max-width constraint for navbar container and add padding - for main pages only */
@media (min-width: 769px) {
    body:not(.privacy-page):not(.about-page):not(.contribution-page):not(.license-page) .navbar .container {
        max-width: none;
        padding-left: 4rem;
        padding-right: 4rem;
    }
    
    body:not(.privacy-page):not(.about-page):not(.contribution-page):not(.license-page) .nav-content {
        justify-content: space-around;
    }
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: translateX(2px);
}

.logo-icon {
    width: 2.25rem;
    height: 2.25rem;
    color: var(--accent-primary);
    transition: transform 0.3s ease;
}

.logo:hover .logo-icon {
    transform: rotate(-15deg) scale(1.1);
}

.logo-text {
    display: inline-block;
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    animation: gradient-shift 3s ease infinite;
    position: relative;
}

.dark-theme .logo-text {
    background-image: linear-gradient(135deg, #22c55e 0%, #16a34a 25%, #4ade80 50%, #10b981 75%, #22c55e 100%);
}

.light-theme .logo-text {
    background-image: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    align-items: center;
    margin-left: auto;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
    letter-spacing: 0.01em;
}

.nav-link:hover {
    color: var(--accent-primary);
}

/* Active navigation link styles - high specificity */
.nav-link.active,
a.nav-link.active,
.nav-links .nav-link.active,
.nav-links a.nav-link.active,
.nav-content .nav-links .nav-link.active,
.nav-content .nav-links a.nav-link.active,
.navbar .nav-links .nav-link.active,
.navbar .nav-links a.nav-link.active {
    color: var(--accent-primary) !important;
    font-weight: 600 !important;
}

.nav-link.active::after,
a.nav-link.active::after,
.nav-links .nav-link.active::after,
.nav-links a.nav-link.active::after,
.nav-content .nav-links .nav-link.active::after,
.nav-content .nav-links a.nav-link.active::after,
.navbar .nav-links .nav-link.active::after,
.navbar .nav-links a.nav-link.active::after {
    content: '' !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 2px !important;
    background: var(--gradient-primary) !important;
    border-radius: 2px 2px 0 0 !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 1 !important;
}

.theme-toggle {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    width: 3.5rem;
    height: 2rem;
    display: flex;
    align-items: center;
}

/* Desktop: Hide mobile theme toggle */
.theme-toggle-mobile {
    display: none;
}

.theme-toggle-track {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 1rem;
    transition: background-color 0.3s ease;
    background-color: #fef3c7; /* Light yellow/cream for light mode */
}

.dark-theme .theme-toggle-track {
    background-color: rgba(15, 23, 15, 0.8); /* Dark green/black matching dark theme */
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.theme-toggle-thumb {
    position: absolute;
    top: 0.125rem;
    left: 0.125rem;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background-color: #fbbf24; /* Yellow thumb for light mode */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.dark-theme .theme-toggle-thumb {
    transform: translateX(1.5rem);
    background-color: #22c55e; /* Green thumb matching dark theme accent */
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.4), 0 0 0 1px rgba(34, 197, 94, 0.2);
}

.theme-toggle-thumb svg {
    width: 1rem;
    height: 1rem;
    color: white;
    position: absolute;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.theme-icon-sun {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.theme-icon-moon {
    opacity: 0;
    transform: scale(0.8) rotate(-90deg);
}

.dark-theme .theme-icon-sun {
    opacity: 0;
    transform: scale(0.8) rotate(90deg);
}

.dark-theme .theme-icon-moon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.theme-toggle:hover .theme-toggle-thumb {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.theme-toggle:active .theme-toggle-thumb {
    transform: translateX(0) scale(0.95);
}

.dark-theme .theme-toggle:active .theme-toggle-thumb {
    transform: translateX(1.5rem) scale(0.95);
}

.theme-icon {
    width: 1.5rem;
    height: 1.5rem;
    position: absolute;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.theme-icon-moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.theme-icon-sun {
    opacity: 0;
    transform: rotate(180deg) scale(0.5);
}

.light-theme .theme-icon-moon {
    opacity: 0;
    transform: rotate(-180deg) scale(0.5);
}

.light-theme .theme-icon-sun {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.dark-theme .theme-icon {
    color: #4ade80;
}

.light-theme .theme-icon {
    color: #fbbf24;
}

/* Buttons */
.btn {
    padding: 0.875rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary .btn-icon {
    fill: white;
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary .btn-icon {
    stroke: currentColor;
    fill: none;
}

/* Hero Section - Common Styles */
.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
    padding-top: 6rem;
    background: var(--bg-primary);
}

.hero .container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.hero-content {
    text-align: center;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

/* Section Styles */
section {
    padding: 5rem 0;
}

section:first-of-type {
    padding-top: 7rem;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.section-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
}

/* Quick Links Section */
.quick-links {
    background: var(--bg-primary);
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.link-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2rem;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    display: block;
}

.dark-theme .link-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-elevated) 100%);
}

.link-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.link-icon {
    width: 3.5rem;
    height: 3.5rem;
    margin: 0 auto 1rem;
    color: var(--accent-primary);
    transition: transform 0.3s ease;
}

.link-icon svg {
    width: 100%;
    height: 100%;
}

.link-card:hover .link-icon {
    transform: scale(1.1) rotate(5deg);
}

.link-card h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.link-card p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 4rem 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-section h3,
.footer-section h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.footer-section p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-bottom: 0.5rem;
}

.footer-meta {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-link-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.footer-section ul li a:hover {
    color: var(--accent-primary);
}

.footer-section ul li a:hover .footer-link-icon {
    opacity: 1;
    transform: translateX(2px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

.footer-bottom .org-name {
    text-transform: uppercase;
}

/* Mobile Footer Adjustments */
@media (max-width: 768px) {
    .footer-content {
        gap: 2rem;
        margin-bottom: 2rem;
    }
    
    .footer-bottom,
    .footer-bottom p {
        font-size: 0.75rem !important;
    }
}

/* Mobile Bottom Navigation */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 0.375rem 0 calc(0.375rem + env(safe-area-inset-bottom));
    z-index: 1000;
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.3);
    border-radius: 0;
}

.dark-theme .mobile-nav {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-top-color: var(--border-color);
}

.light-theme .mobile-nav {
    background: var(--bg-card);
    border-top-color: var(--border-color);
}

.mobile-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.mobile-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    padding: 0.375rem 0.75rem;
    text-decoration: none;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    flex: 1;
    position: relative;
}

.mobile-nav-icon {
    width: 1.25rem;
    height: 1.25rem;
    transition: all 0.3s ease;
}

.mobile-nav-label {
    font-size: 0.7rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    color: var(--accent-primary);
}

.mobile-nav-link.active .mobile-nav-icon {
    transform: scale(1.1);
    color: var(--accent-primary);
}

.mobile-nav-link.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 3rem;
    height: 3px;
    background: var(--accent-primary);
    border-radius: 0 0 3px 3px;
}

.dark-theme .mobile-nav-link.active::before {
    background: var(--gradient-primary);
}

.light-theme .mobile-nav-link.active::before {
    background: var(--gradient-primary);
}

/* Responsive Design - Common */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .nav-content {
        padding: 0.75rem 0;
    }
    
    .navbar {
        padding: 0;
        border-bottom-left-radius: 1rem;
        border-bottom-right-radius: 1rem;
        border-bottom: none;
    }
    
    .logo-group {
        gap: 0.75rem;
    }
    
    .logo {
        font-size: 1.25rem;
    }
    
    .logo-icon {
        width: 1.75rem;
        height: 1.75rem;
    }
    
    /* Theme toggle maintains same styling on mobile */
    .theme-toggle-thumb svg {
        width: 1rem;
        height: 1rem;
    }
    
    /* Mobile Theme Toggle - Hide normal toggle in logo-group, show mobile toggle on right */
    /* Only for home page (body without docs-container class) */
    body:not(:has(.docs-container)) .logo-group .theme-toggle {
        display: none;
    }
    
    body:not(:has(.docs-container)) .theme-toggle-mobile {
        display: flex;
        align-items: center;
        margin-left: auto;
        order: 2;
    }
    
    /* Reduce paragraph font size on mobile */
    p {
        font-size: 0.9375rem; /* 15px - reduced from default 16px */
        line-height: 1.7;
    }
    
    .content p,
    .section-content p,
    .info-box p,
    .card p,
    .link-card p {
        font-size: 0.9375rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .mobile-nav {
        display: flex;
        border-top-left-radius: 1rem;
        border-top-right-radius: 1rem;
        border-top: none;
    }
    
    body {
        padding-bottom: 3.5rem;
    }
}

@media (min-width: 769px) {
    .mobile-nav {
        display: none;
    }
    
    body {
        padding-bottom: 0;
    }
}

/* Toast Notification System */
.toast-container {
    position: fixed;
    top: 6rem;
    right: 2rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    pointer-events: none;
}

.toast-notification {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-xl);
    min-width: 250px;
    max-width: 400px;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: auto;
}

.dark-theme .toast-notification {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-elevated) 100%);
    border-color: var(--accent-primary);
    box-shadow: 0 8px 32px rgba(34, 197, 94, 0.3), 0 0 0 1px rgba(34, 197, 94, 0.1);
}

.light-theme .toast-notification {
    background: #ffffff;
    border-color: var(--accent-primary);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(0);
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--accent-primary);
    flex-shrink: 0;
}

.toast-message {
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-weight: 500;
    flex: 1;
}

/* Mobile Toast */
@media (max-width: 768px) {
    .toast-container {
        top: 5.5rem;
        right: 1rem;
        left: 1rem;
        align-items: stretch;
    }
    
    .toast-notification {
        min-width: auto;
        max-width: 100%;
        transform: translateY(-100px);
    }
    
    .toast-notification.show {
        transform: translateY(0);
    }
}

/* Smooth Transitions */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
