/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Professional Technical Color Palette */
    --bg-primary: #0a0e14;
    --bg-secondary: #151a21;
    --bg-surface: #1d232e;
    --bg-card: #252b37;
    
    --accent-primary: #0066cc;
    --accent-secondary: #00aaff;
    --accent-success: #00cc88;
    --accent-warning: #ffaa00;
    --accent-error: #ff4444;
    
    --text-primary: #e6e6e6;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    
    --border-color: #2d333b;
    --border-light: #3c4452;
    
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
    
    --border-radius: 8px;
    --border-radius-sm: 4px;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 16px;
}

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

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1em;
    color: var(--text-secondary);
}

/* ===== HEADER ===== */
.header {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-surface) 100%);
    border-bottom: 1px solid var(--border-color);
    padding: 2rem 0;
}

.logo-section {
    text-align: center;
    margin-bottom: 2rem;
}

.logo {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.tagline, .sub-tagline {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.navigation {
    display: flex;
    justify-content: center;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-link:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    padding: 3rem 0;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    align-items: start;
}

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* ===== VERSION POSTS ===== */
.version-post .post-header {
    display: flex;
    justify-content: between;
    align-items: start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.post-date {
    color: var(--text-muted);
    font-size: 0.9rem;
    background: var(--bg-surface);
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-light);
}

.language-section {
    margin-bottom: 1.5rem;
}

.language-section h4 {
    color: var(--accent-secondary);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.feature-list {
    list-style: none;
    margin-left: 0;
}

.feature-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.feature-list li:before {
    content: "▸";
    color: var(--accent-primary);
    position: absolute;
    left: 0;
}

/* ===== BUTTONS & LINKS ===== */
.btn-primary, .btn-secondary, .btn-download {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-align: center;
    margin: 0.25rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
}

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

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

.btn-secondary:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.btn-download {
    background: linear-gradient(135deg, var(--accent-success), #00b377);
    color: white;
    font-size: 1.1rem;
    padding: 1rem 2rem;
}

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

.accent-link {
    color: var(--accent-secondary);
    text-decoration: none;
    font-weight: 500;
}

.accent-link:hover {
    text-decoration: underline;
}

/* ===== POST LAYOUT ===== */
.post-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.download-cta {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
}

/* ===== SIDEBAR ===== */
.sidebar-card h3 {
    color: var(--accent-primary);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 0.5rem;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-link {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    transition: all 0.3s ease;
    margin-bottom: 0.25rem;
}

.sidebar-link:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
    padding-left: 1.25rem;
}

.certification-badge {
    text-align: center;
    padding: 1rem 0;
}

.certification-badge img {
    border-radius: var(--border-radius);
    transition: transform 0.3s ease;
}

.certification-badge img:hover {
    transform: scale(1.05);
}

/* ===== FOOTER ===== */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0;
    margin-top: 3rem;
}

.footer-content {
    text-align: center;
    color: var(--text-muted);
}

.footer p {
    margin-bottom: 0.5rem;
}

.license {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
}

.license a {
    color: var(--accent-secondary);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 968px) {
    .content-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .sidebar {
        order: -1;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .logo {
        font-size: 2.5rem;
    }
    
    .nav-menu {
        gap: 1rem;
    }
    
    .nav-link {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .post-header {
        flex-direction: column;
        align-items: start;
    }
    
    .post-links {
        flex-direction: column;
    }
    
    .btn-primary, .btn-secondary, .btn-download {
        width: 100%;
        margin: 0.25rem 0;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 1.5rem 0;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .tagline, .sub-tagline {
        font-size: 1rem;
    }
    
    .nav-menu {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .nav-link {
        width: 200px;
        text-align: center;
    }
    
    .main-content {
        padding: 2rem 0;
    }
    
    .card {
        padding: 1rem;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
.nav-link:focus,
.btn-primary:focus,
.btn-secondary:focus,
.sidebar-link:focus {
    outline: 2px solid var(--accent-secondary);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --bg-primary: #000000;
        --bg-secondary: #111111;
        --text-primary: #ffffff;
        --text-secondary: #cccccc;
        --border-color: #444444;
    }
}

/* ===== DOWNLOADS PAGE SPECIFIC STYLES ===== */

/* Donation Section */
.donation-card {
    text-align: center;
    background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-card) 100%);
    border: 1px solid var(--accent-primary);
}

.donation-content {
    max-width: 600px;
    margin: 0 auto;
}

.donation-text {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.paypal-btn {
    margin: 1rem 0;
    transition: transform 0.3s ease;
}

.paypal-btn:hover {
    transform: scale(1.05);
}

/* Warning & Notices */
.notices-section {
    margin: 2rem 0;
}

.warning-card {
    border-left: 4px solid var(--accent-warning);
    background: linear-gradient(135deg, var(--bg-surface) 0%, #2a2a2a 100%);
}

.warning-title {
    color: var(--accent-warning);
    margin-bottom: 1.5rem;
}

.warning-item, .disclaimer-card {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-light);
}

.warning-item h4, .disclaimer-card h4 {
    color: var(--accent-secondary);
    margin-bottom: 0.5rem;
}

.disclaimer-card {
    border-left: 4px solid var(--accent-error);
    background: linear-gradient(135deg, var(--bg-surface) 0%, #2a1a1a 100%);
}

/* Quick Links */
.quick-links {
    margin: 2rem 0;
}

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

.quick-link {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: var(--bg-surface);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
    font-weight: 500;
}

.quick-link:hover {
    background: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* Downloads Section */
.downloads-section {
    margin: 3rem 0;
}

.section-title {
    color: var(--accent-primary);
    font-size: 2rem;
    margin-bottom: 1rem;
    text-align: center;
}

.last-updated {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-style: italic;
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    background: var(--bg-surface);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    margin: 2rem 0;
}

.firmware-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
}

.firmware-table th {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--accent-primary);
}

.firmware-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
}

.firmware-table tr:hover {
    background: var(--bg-surface);
}

/* Category Rows */
.category-row {
    background: var(--bg-secondary) !important;
}

.category-header {
    color: var(--accent-primary);
    font-weight: 700;
    font-size: 1.1rem;
    padding: 1rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Download Buttons */
.download-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--accent-success);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 80px;
}

.download-btn:hover {
    background: #00b377;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.source-btn {
    background: var(--accent-secondary);
}

.source-btn:hover {
    background: #0099cc;
}

/* Active Navigation Link */
.nav-link.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* Responsive Table */
@media (max-width: 768px) {
    .firmware-table {
        font-size: 0.9rem;
    }
    
    .firmware-table th,
    .firmware-table td {
        padding: 0.5rem 0.75rem;
    }
    
    .links-grid {
        grid-template-columns: 1fr;
    }
    
    /* Stack table cells on mobile */
    .firmware-table thead {
        display: none;
    }
    
    .firmware-table tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--border-light);
        border-radius: var(--border-radius);
    }
    
    .firmware-table td {
        display: block;
        text-align: right;
        border-bottom: 1px solid var(--border-light);
    }
    
    .firmware-table td:last-child {
        border-bottom: none;
    }
    
    .firmware-table td::before {
        content: attr(data-label);
        float: left;
        font-weight: bold;
        color: var(--text-primary);
    }
    
    .category-row td {
        text-align: center;
    }
    
    .category-row td::before {
        display: none;
    }
}

@media (max-width: 480px) {
    .donation-text {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .download-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
        min-width: 70px;
    }
}

/* ===== WRT1900AC PAGE SPECIFIC STYLES ===== */

/* Guide Layout */
.guide-card {
    margin-bottom: 2rem;
}

.guide-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-light);
}

.guide-title {
    color: var(--accent-primary);
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.guide-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Warning Banner */
.warning-banner {
    background: linear-gradient(135deg, var(--bg-surface) 0%, #2a1a1a 100%);
    border-left: 4px solid var(--accent-error);
    margin: 2rem 0;
}

.warning-title {
    color: var(--accent-error);
    margin-bottom: 1rem;
}

.warning-text {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

/* Requirements Section */
.requirements-section {
    margin: 2rem 0;
}

.requirements-list {
    list-style: none;
    margin: 1.5rem 0;
}

.requirement-item {
    background: var(--bg-surface);
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--accent-secondary);
}

.requirement-text {
    display: block;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.requirement-desc {
    display: block;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 0.5rem;
}

.image-links {
    margin-top: 0.5rem;
}

.image-link {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--accent-primary);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    font-size: 0.8rem;
    margin-right: 0.5rem;
    transition: all 0.3s ease;
}

.image-link:hover {
    background: var(--accent-secondary);
    transform: translateY(-1px);
}

/* Steps Section */
.steps-section {
    margin: 3rem 0;
}

.step-card {
    margin-bottom: 2rem;
    border-left: 4px solid var(--accent-primary);
    transition: transform 0.3s ease;
}

.step-card:hover {
    transform: translateX(5px);
}

.step-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: var(--accent-primary);
    color: white;
    border-radius: 50%;
    font-weight: bold;
    margin-right: 1rem;
    flex-shrink: 0;
}

.step-title {
    color: var(--text-primary);
    margin: 0;
    font-size: 1.3rem;
}

.step-desc {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.step-detail {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.4;
}

.step-images {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.step-image-link {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: var(--bg-surface);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-light);
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.step-image-link:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* Notes Section */
.notes-section {
    margin: 2rem 0;
}

.notes-content {
    background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-card) 100%);
    border-left: 4px solid var(--accent-success);
}

.note-text {
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.note-text:last-child {
    margin-bottom: 0;
}

/* Flash Container */
.flash-container {
    text-align: center;
    padding: 1rem 0;
}

.flash-container object {
    border-radius: var(--border-radius);
    border: 1px solid var(--border-light);
}

/* Responsive Design for Guide */
@media (max-width: 768px) {
    .guide-title {
        font-size: 2rem;
    }
    
    .guide-meta {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }
    
    .step-header {
        flex-direction: column;
        align-items: start;
    }
    
    .step-number {
        margin-bottom: 0.5rem;
        margin-right: 0;
    }
    
    .step-images {
        flex-direction: column;
    }
    
    .step-image-link {
        text-align: center;
    }
    
    .requirement-item {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .guide-title {
        font-size: 1.5rem;
    }
    
    .step-title {
        font-size: 1.1rem;
    }
    
    .image-link {
        display: block;
        margin-bottom: 0.5rem;
        text-align: center;
    }
}