/* aeklink Documentation Portal Styles */

/* Import site variables */
:root {
    /* Primary Colors - Apple-inspired */
    --primary-color: #007AFF;
    --primary-hover: #0056CC;
    --primary-active: #004499;
    --secondary-color: #8E8E93;
    --accent-color: #AF52DE;
    
    /* OLED Black Backgrounds */
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-tertiary: #111111;
    --bg-quaternary: #1a1a1a;
    
    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #d1d1d6;
    --text-tertiary: #8e8e93;
    --text-muted: #636366;
    
    /* Border Colors */
    --border-color: #2c2c2e;
    --border-light: #3a3a3c;
    --border-subtle: #1c1c1e;
    
    /* Enhanced Shadows for OLED */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.8);
    --shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.9), 0 1px 4px 0 rgba(0, 0, 0, 0.8);
    --shadow-lg: 0 8px 25px 0 rgba(0, 0, 0, 0.95), 0 4px 12px 0 rgba(0, 0, 0, 0.9);
    
    /* Status Colors */
    --success-color: #34C759;
    --warning-color: #FF9500;
    --error-color: #FF3B30;
    --info-color: #5AC8FA;
    
    /* Documentation specific */
    --card-bg: var(--bg-tertiary);
    --card-border: var(--border-color);
    --card-hover-bg: var(--bg-quaternary);
}

/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-hover);
}

/* Header */
.docs-header {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
}

.docs-nav {
    padding: 1rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--text-primary);
}

.brand-link:hover {
    color: var(--primary-color);
}

.brand-logo {
    font-size: 1.5rem;
}

.nav-separator {
    color: var(--text-tertiary);
    font-size: 1rem;
}

.nav-current {
    color: var(--text-secondary);
    font-weight: 500;
}

.nav-actions {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--primary-color);
}

/* Language Selector */
.language-selector {
    position: relative;
    display: inline-block;
}

.language-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.language-toggle:hover {
    color: var(--text-primary);
    border-color: var(--primary-color);
    background: var(--bg-quaternary);
}

.language-toggle.active {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.current-lang {
    font-weight: 600;
    min-width: 20px;
}

.dropdown-arrow {
    transition: transform 0.2s ease;
}

.language-toggle.active .dropdown-arrow {
    transform: rotate(180deg);
}

.language-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    min-width: 140px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1100;
}

.language-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.language-option:hover {
    color: var(--text-primary);
    background: var(--bg-quaternary);
}

.language-option.active {
    color: var(--primary-color);
    background: rgba(0, 122, 255, 0.1);
}

.language-option .flag {
    font-size: 1rem;
}

.language-option span:last-child {
    flex: 1;
}

/* Main Content */
.docs-main {
    flex: 1;
    padding: 2rem 0;
}

.docs-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Hero Section */
.docs-hero {
    text-align: center;
    padding: 4rem 0 6rem;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 4rem;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.25rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 3rem;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Documentation Grid */
.docs-grid {
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 2rem;
    text-align: center;
}

.docs-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.doc-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.doc-card:hover {
    background: var(--card-hover-bg);
    border-color: var(--border-light);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.doc-card.featured {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(0, 122, 255, 0.05) 100%);
}

.doc-card.featured::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--accent-color) 100%);
}

.card-icon {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.card-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.card-meta {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.meta-badge {
    background: var(--bg-quaternary);
    color: var(--text-tertiary);
    padding: 0.375rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.meta-badge.primary {
    background: var(--primary-color);
    color: white;
}

.card-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
}

.card-action:hover {
    background: var(--primary-hover);
    color: white;
    transform: translateX(4px);
}

.card-action.disabled {
    background: var(--bg-quaternary);
    color: var(--text-tertiary);
    cursor: not-allowed;
    pointer-events: none;
}

/* Quick Links */
.quick-links {
    margin-bottom: 4rem;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.link-group {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.5rem;
}

.group-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.links-list {
    list-style: none;
}

.links-list li {
    margin-bottom: 0.5rem;
}

.links-list a {
    color: var(--text-secondary);
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.links-list a:hover {
    color: var(--primary-color);
}

/* Footer */
.docs-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-subtle);
    padding: 2rem 0;
    margin-top: auto;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-left p {
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

.footer-right {
    display: flex;
    gap: 2rem;
}

.footer-right a {
    color: var(--text-tertiary);
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.footer-right a:hover {
    color: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .nav-actions {
        justify-content: center;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-description {
        font-size: 1.125rem;
    }
    
    .hero-stats {
        gap: 2rem;
    }
    
    .docs-cards {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .doc-card {
        padding: 1.5rem;
    }
    
    .links-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .docs-container {
        padding: 0 0.75rem;
    }
    
    .docs-hero {
        padding: 3rem 0 4rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .docs-cards {
        gap: 1rem;
    }
    
    .doc-card {
        padding: 1.25rem;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.doc-card {
    animation: fadeInUp 0.6s ease-out;
}

.doc-card:nth-child(1) { animation-delay: 0.1s; }
.doc-card:nth-child(2) { animation-delay: 0.2s; }
.doc-card:nth-child(3) { animation-delay: 0.3s; }
.doc-card:nth-child(4) { animation-delay: 0.4s; }
.doc-card:nth-child(5) { animation-delay: 0.5s; }
.doc-card:nth-child(6) { animation-delay: 0.6s; }

/* Focus States */
.card-action:focus,
.nav-link:focus,
a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .docs-header,
    .docs-footer {
        display: none;
    }
    
    .docs-main {
        padding: 0;
    }
    
    .doc-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}