/* ===== TOP NAVIGATION STYLES ===== */
/* Top Navigation Bar */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1002;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    height: 70px;
}

.top-nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
}

/* Brand/Logo Section */
.nav-brand {
    display: flex;
    align-items: center;
    z-index: 1003;
}

.brand-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 0.75rem;
}

.nav-logo {
    height: 45px;
    width: auto;
    border-radius: 6px;
}

.site-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2563eb;
    letter-spacing: -0.5px;
    white-space: nowrap;
}

/* Navigation Links */
.nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.5rem;
}

.nav-item {
    margin: 0;
}

.nav-link {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    text-decoration: none;
    color: #374151;
    font-weight: 500;
    font-size: 1rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
}

.nav-link:hover {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.05);
}

.nav-link.active {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.1);
    font-weight: 600;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background: #2563eb;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    gap: 4px;
    transition: all 0.2s ease;
    z-index: 1003;
}

.mobile-menu-toggle:hover {
    background: #1d4ed8;
    transform: scale(1.05);
}

.hamburger-line {
    width: 20px;
    height: 2px;
    background: white;
    border-radius: 1px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Authentication Section */
.nav-auth {
    display: flex;
    align-items: center;
    z-index: 1003;
}

.auth-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auth-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6b7280;
    font-size: 0.9rem;
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.auth-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: #24292e;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.auth-btn:hover {
    background: #2f363d;
    transform: translateY(-1px);
}

.github-icon {
    width: 16px;
    height: 16px;
    filter: invert(1);
}

.auth-text {
    white-space: nowrap;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
}

.user-name {
    font-weight: 500;
    color: #374151;
    font-size: 0.9rem;
}

.logout-btn {
    padding: 0.5rem 0.8rem;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

/* Mobile Navigation Styles */
@media (max-width: 768px) {
    .top-nav-container {
        padding: 0 1rem;
    }
    
    .site-title {
        font-size: 1.1rem;
        display: none; /* Hide on very small screens */
    }
    
    .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        height: calc(100vh - 70px);
        background: white;
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 2rem;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1001;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }
    
    .nav-links.mobile-open {
        transform: translateX(0);
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
        padding: 0 2rem;
    }
    
    .nav-link {
        padding: 1rem 1.5rem;
        text-align: center;
        font-size: 1.1rem;
        border-radius: 10px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .auth-text {
        display: none;
    }
    
    .user-name {
        display: none;
    }
}

@media (max-width: 480px) {
    .site-title {
        display: none;
    }
    
    .nav-logo {
        height: 35px;
    }
    
    .user-avatar {
        width: 28px;
        height: 28px;
    }
    
    .logout-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }
}

/* Body padding adjustment for fixed top nav */
body {
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0;
    background: #f7fafd;
    color: #222;
    padding-top: var(--top-nav-height); /* Account for fixed top nav */
}

/* Left Navigation (Dashboard Only) */
.left-nav {
    position: fixed;
    top: var(--top-nav-height); /* Account for top navigation */
    left: 0;
    width: 200px;
    height: calc(100vh - var(--top-nav-height));
    background: #f8fafc;
    border-right: 1px solid #e5e7eb;
    padding: 2em 1em 1em 1em;
    overflow-y: auto;
    z-index: 10;
}

.left-nav h3 {
    font-size: 1.1em;
    margin-bottom: 1em;
    color: #374151;
    font-weight: 600;
}

.left-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.left-nav li {
    margin-bottom: 0.7em;
}

.left-nav a {
    color: #2563eb;
    text-decoration: none;
    font-size: 1em;
    transition: color 0.2s;
}

.left-nav a:hover {
    color: #1e40af;
    text-decoration: underline;
}

/* Adjust main content for pages with left nav */
.with-left-nav .header,
.with-left-nav .dashboard-grid,
.with-left-nav #progress,
.with-left-nav .recent-activity,
.with-left-nav .leaderboard-section,
.with-left-nav .chart-section {
    margin-left: 220px;
}
.container {
    max-width: 1200px;
    margin: 2em auto;
    padding: 0 2em;
}
.header {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.07);
    padding: 2em 2.5em;
    margin-bottom: 2em;
    display: flex;
    align-items: center;
    gap: 2em;
}
.tux-logo {
    max-width: 80px;
    flex-shrink: 0;
}
h1 {
    font-size: 2.2em;
    font-weight: 700;
    margin: 0;
    color: #2563eb;
    letter-spacing: -1px;
}
.subtitle {
    color: #666;
    font-size: 1.1em;
    margin: 0.5em 0 0 0;
}
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5em;
    margin-bottom: 2.5em;
}
.metric-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    padding: 2em 1.5em 1.5em 1.5em;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: box-shadow 0.2s;
}
.metric-card.success { border-left: 5px solid #10b981; }
.metric-card.warning { border-left: 5px solid #f59e42; }
.metric-card.danger { border-left: 5px solid #ef4444; }
.metric-title {
    font-size: 1.1em;
    color: #6b7280;
    margin-bottom: 0.5em;
}
.metric-value {
    font-size: 2.1em;
    font-weight: 700;
    color: #2563eb;
    margin-bottom: 0.2em;
}
.metric-subtitle {
    color: #64748b;
    font-size: 0.95em;
}
.recent-activity {
    background: #fff;
    border-radius: 12px;
    padding: 2em;
    box-shadow: 0 2px 16px rgba(0,0,0,0.07);
    margin-bottom: 2em;
}
.recent-activity h2 {
    margin-top: 0;
    color: #1f2937;
    font-size: 1.5em;
}
.activity-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5em;
}
.activity-table th {
    text-align: left;
    padding: 1em 0.8em;
    border-bottom: 2px solid #e5e7eb;
    color: #6b7280;
    font-weight: 600;
    font-size: 0.95em;
}
.activity-table td {
    padding: 1em 0.8em;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: top;
}
.activity-table tr:hover {
    background: #f9fafb;
}
.bias-percentage.low { color: #10b981; font-weight: 600; }
.bias-percentage.medium { color: #f59e42; font-weight: 600; }
.bias-percentage.high { color: #ef4444; font-weight: 600; }
.status-badge {
    padding: 0.3em 0.8em;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
}
.status-badge.completed {
    background: #d1fae5;
    color: #065f46;
}
.status-badge.running {
    background: #fef3c7;
    color: #92400e;
}
.status-badge.failed {
    background: #fee2e2;
    color: #991b1b;
}
.view-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}
.view-link:hover {
    text-decoration: underline;
}
.snippet-card {
    background: #f9fafb;
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
    margin-bottom: 1.5em;
    padding: 1.5em 1.2em;
    border-left: 4px solid #2563eb;
}
.snippet-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1em;
}
.snippet-meta {
    font-size: 0.98em;
    color: #64748b;
}
.snippet-url {
    font-size: 1.05em;
    color: #2563eb;
    font-weight: 600;
    margin-bottom: 0.2em;
    word-break: break-all;
}
.snippet-scan-info {
    font-size: 0.93em;
    color: #6b7280;
}
.snippet-score {
    background: #ef4444;
    color: #fff;
    font-size: 0.95em;
    font-weight: 700;
    border-radius: 6px;
    padding: 0.3em 1em;
    align-self: flex-start;
}
.snippet-content {
    margin-bottom: 0.7em;
}
.snippet-label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.2em;
    margin-top: 1.2em;
}
.snippet-text {
    background: #fff;
    border-radius: 6px;
    padding: 0.7em 1em;
    font-size: 1em;
    color: #222;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
    margin-bottom: 0.2em;
    word-break: break-all;
}
.analysis-content {
    margin-top: 1em;
    padding: 0.5em 0.5em 0.5em 0.5em;
}
.analysis-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.3em;
}
.analysis-icon {
    margin-right: 0.5em;
    font-size: 1.1em;
}
.analysis-explanation {
    margin-top: 0.5em;
    background: #fff;
    border-radius: 6px;
    padding: 0.6em 1em;
    color: #374151;
    font-size: 0.98em;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}
.explanation-label {
    font-weight: 600;
    margin-bottom: 0.2em;
}
.snippet-actions {
    margin-top: 1em;
}
.snippet-actions .view-link {
    font-size: 1em;
    color: #2563eb;
    font-weight: 600;
}
.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1em;
}
.progress-title {
    font-size: 1.2em;
    font-weight: 700;
    color: #2563eb;
}
.progress-stage {
    font-size: 1em;
    color: #64748b;
}
.progress-stats {
    display: flex;
    gap: 2em;
    margin-bottom: 1em;
}
.progress-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.progress-stat-value {
    font-size: 1.5em;
    font-weight: 700;
    color: #2563eb;
}
.progress-stat-label {
    color: #6b7280;
    font-size: 0.95em;
}
.page-section {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 2em;
    padding: 1.5em 2em 1.5em 2em;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}
/* --- Admin Dashboard Styles: Improved for Modern Card Layout --- */
.admin-controls {
    background: #fff;
    border-radius: 16px;
    padding: 2em 2em 1.5em 2em;
    box-shadow: 0 2px 16px rgba(0,0,0,0.07);
    margin-bottom: 2em;
}
.admin-controls h2 {
    margin-top: 0;
    color: #1f2937;
    font-size: 1.5em;
    font-weight: 700;
    letter-spacing: -1px;
}
.control-grid {
    display: flex;
    gap: 2em;
    flex-wrap: wrap;
    margin-top: 1em;
}
.control-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5em 1.5em 1.2em 1.5em;
    flex: 1 1 300px;
    min-width: 270px;
    max-width: 370px;
    box-shadow: 0 1px 8px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    margin-bottom: 1em;
}
.control-card h3 {
    margin-top: 0;
    color: #2563eb;
    font-size: 1.15em;
    font-weight: 700;
    margin-bottom: 1em;
}
.form-group {
    margin-bottom: 1em;
}
.form-group label {
    display: block;
    margin-bottom: 0.5em;
    font-weight: 600;
    color: #374151;
}
input[type="text"], select {
    width: 100%;
    padding: 0.7em;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1em;
    background: #fff;
    margin-bottom: 0.3em;
}
input[type="text"]:focus, select:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
button, .btn {
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.7em 1.3em;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0.5em;
}
button:hover:not(:disabled), .btn:hover:not(:disabled) {
    background: #1d4ed8;
}
button:disabled, .btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}
.btn-secondary {
    background: #6b7280;
    color: #fff;
    margin-left: 0.5em;
}
.btn-secondary:hover {
    background: #4b5563;
}
.admin-actions {
    display: flex;
    gap: 1em;
    margin-top: 1em;
}
.scan-history {
    background: #fff;
    border-radius: 16px;
    padding: 2em;
    box-shadow: 0 2px 16px rgba(0,0,0,0.07);
    margin-top: 2em;
}
.scan-history h2 {
    margin-top: 0;
    color: #1f2937;
    font-size: 1.5em;
    font-weight: 700;
}
.scan-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1em;
}
.scan-table th {
    text-align: left;
    padding: 1em 0.8em;
    border-bottom: 2px solid #e5e7eb;
    color: #6b7280;
    font-weight: 600;
    font-size: 0.95em;
}
.scan-table td {
    padding: 1em 0.8em;
    border-bottom: 1px solid #f3f4f6;
}
.scan-table tr:hover {
    background: #f9fafb;
}
.status-badge.completed {
    background: #d1fae5;
    color: #065f46;
}
.status-badge.running {
    background: #fef3c7;
    color: #92400e;
}
.status-badge.failed {
    background: #fee2e2;
    color: #991b1b;
}
.explanation-text {
    margin-bottom: 1.2em;
    margin-top: 0.8em;
}
.explanation-text ul, ul.explanation-text {
    margin-top: 0.5em;
    margin-bottom: 1em;
    margin-left: 0;
    padding-left: 1.2em;
}
.explanation-text li {
    margin-bottom: 0.5em;
    line-height: 1.5;
}
.bias-types-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7em;
    margin: 0.7em 0 1.2em 0;
}
.bias-type-box {
    display: flex;
    align-items: center;
    gap: 0.4em;
    background: #f1f5fb;
    border-radius: 8px;
    padding: 0.4em 1em 0.4em 0.8em;
    font-weight: 600;
    color: #2563eb;
    font-size: 1em;
    box-shadow: 0 2px 8px rgba(37,99,235,0.07);
    border: 1px solid #dbeafe;
    white-space: nowrap;
}
.bias-type-icon {
    font-size: 1.2em;
}
.priority-badge {
    display: inline-block;
    font-size: 0.95em;
    font-weight: 700;
    padding: 0.3em 1em;
    border-radius: 16px;
    margin-left: 1em;
    margin-top: 0.2em;
    color: #fff;
}
.priority-high {
    background: #dc2626;
}
.priority-medium {
    background: #f59e42;
    color: #222;
}
.priority-low {
    background: #10b981;
}
@media (max-width: 1100px) {
    .control-grid { flex-direction: column; gap: 1em; }
    .control-card { max-width: 100%; }
}
@media (max-width: 768px) {
    .admin-controls { padding: 1em; }
    .control-grid { flex-direction: column; gap: 1em; }
    .control-card { padding: 1em; }
}
/* Mobile Navigation Styles */
.mobile-nav-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    width: 45px;
    height: 45px;
    background: #2563eb;
    border-radius: 8px;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

.mobile-nav-toggle:hover {
    background: #1d4ed8;
    transform: scale(1.05);
}

.hamburger-line {
    width: 22px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-nav-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-nav-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-nav-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-nav-overlay.active {
    opacity: 1;
}

/* Mobile responsive updates */
@media (max-width: 900px) {
    .mobile-nav-toggle {
        display: flex;
    }
    
    .mobile-nav-overlay.active {
        display: block;
    }
    
    .left-nav {
        position: fixed !important;
        top: 70px !important; /* Account for top nav */
        left: 0 !important;
        height: calc(100vh - 70px) !important;
        width: 280px !important;
        background: #f8fafc !important;
        transform: translateX(-100%);
        transition: transform 0.3s ease !important;
        z-index: 1000 !important;
        box-shadow: 2px 0 8px rgba(0,0,0,0.15) !important;
        overflow-y: scroll !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 0 !important;
        border-right: 1px solid #e5e7eb !important;
        max-height: calc(100vh - 70px) !important;
        display: block !important;
    }
    
    .left-nav.mobile-open {
        transform: translateX(0) !important;
    }
    
    .left-nav > * {
        padding-left: 1em !important;
        padding-right: 1em !important;
    }
    
    .left-nav h3 {
        margin-top: 1em !important;
        margin-bottom: 1em !important;
        padding-top: 0.5em !important;
        padding-bottom: 0 !important;
    }
    
    .left-nav ul {
        padding-bottom: 3em !important; /* Extra space at bottom for scrolling */
        margin-bottom: 0 !important;
    }
    
    .left-nav li {
        margin-bottom: 0.7em !important;
    }
    
    .header, .dashboard-grid, #progress, .recent-activity, .leaderboard-section {
        margin-left: 0 !important;
        padding-top: 70px; /* Account for mobile nav toggle */
    }
}

@media (max-width: 600px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .header { 
        flex-direction: column; 
        gap: 1em; 
        padding: 1.5em; 
        padding-top: 2em; /* Extra space for mobile nav */
    }
    .progress-stats { flex-direction: column; gap: 1em; }
    .recent-activity { padding: 1em; }
    .metric-card { padding: 1.2em 1em; }
    
    /* Better mobile spacing */
    .container {
        padding: 0 1em;
    }
}

/* Chart Responsive Styles */
.chart-section {
    background: #fff;
    border-radius: 12px;
    padding: 2em;
    box-shadow: 0 2px 16px rgba(0,0,0,0.07);
    margin-bottom: 2em;
}

.chart-section h2 {
    margin-top: 0;
    color: #1f2937;
    font-size: 1.5em;
    margin-bottom: 1em;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

@media (max-width: 768px) {
    .chart-section {
        margin-left: 0 !important;
        padding: 1.5em 1em;
    }
    
    .chart-container {
        height: 250px; /* Slightly smaller on mobile */
    }
    
    .chart-section h2 {
        font-size: 1.3em;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .chart-container {
        height: 220px; /* Even smaller on very small screens */
    }
}

/* Danger Zone Styles */
.danger-zone {
    background: #fef2f2;
    border: 2px solid #fca5a5;
    border-radius: 16px;
    padding: 2em;
    margin: 2em 0;
    box-shadow: 0 4px 20px rgba(220, 38, 38, 0.15);
}

.danger-zone h2 {
    color: #dc2626;
    margin-top: 0;
    font-size: 1.5em;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.danger-warning {
    color: #7f1d1d;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 1em;
    margin: 1em 0;
    font-weight: 600;
    line-height: 1.5;
}

.danger-card {
    background: #fff;
    border: 2px solid #fca5a5;
    border-radius: 12px;
    padding: 1.5em;
    margin-top: 1.5em;
}

.danger-card h3 {
    color: #dc2626;
    margin-top: 0;
    font-size: 1.2em;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.danger-card p {
    color: #7f1d1d;
    margin: 1em 0;
    line-height: 1.5;
}

.btn-danger {
    background: #dc2626;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.8em 1.5em;
    font-size: 1em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 1em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-danger:hover:not(:disabled) {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-danger:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Mobile Table Optimizations */
@media (max-width: 768px) {
    /* Activity Table Mobile Layout */
    .activity-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
    }
    
    .activity-table thead {
        display: block;
        border-bottom: 2px solid #e5e7eb;
    }
    
    .activity-table tbody {
        display: block;
    }
    
    .activity-table tr {
        display: block;
        border-bottom: 1px solid #f3f4f6;
        padding: 1em;
        white-space: normal;
    }
    
    .activity-table th,
    .activity-table td {
        display: block;
        padding: 0.5em 0;
        border: none;
        text-align: left !important;
    }
    
    .activity-table th {
        display: none; /* Hide table headers on mobile */
    }
    
    .activity-table td {
        position: relative;
        padding-left: 40%;
        word-wrap: break-word;
    }
    
    .activity-table td:before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 35%;
        font-weight: 600;
        color: #6b7280;
        font-size: 0.9em;
    }
    
    /* Leaderboard Table Mobile Layout */
    .leaderboard-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .leaderboard-table thead,
    .leaderboard-table tbody,
    .leaderboard-table tr,
    .leaderboard-table td,
    .leaderboard-table th {
        display: block;
    }
    
    .leaderboard-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .leaderboard-table tr {
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        margin-bottom: 1em;
        padding: 1em;
        background: white;
    }
    
    .leaderboard-table td {
        border: none !important;
        position: relative;
        padding-left: 40%;
        padding-bottom: 0.8em;
        white-space: normal;
    }
    
    .leaderboard-table td:before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 35%;
        font-weight: 600;
        color: #6b7280;
        font-size: 0.9em;
    }
}

@media (max-width: 600px) {
    /* More compact mobile table layout */
    .activity-table td,
    .leaderboard-table td {
        padding-left: 35%;
        font-size: 0.95em;
    }
    
    .activity-table td:before,
    .leaderboard-table td:before {
        width: 30%;
        font-size: 0.85em;
    }
}

/* Mobile Content Layout & Spacing Improvements */
@media (max-width: 768px) {
    /* Snippet Cards Mobile Optimization */
    .snippet-card {
        margin-bottom: 1em;
        padding: 1em;
        border-radius: 8px;
    }
    
    .snippet-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5em;
        margin-bottom: 0.8em;
    }
    
    .snippet-url {
        font-size: 0.95em;
        word-break: break-word;
        line-height: 1.3;
    }
    
    .snippet-score {
        font-size: 0.85em;
        padding: 0.25em 0.8em;
        align-self: flex-start;
    }
    
    .snippet-text {
        font-size: 0.9em;
        padding: 0.6em 0.8em;
        line-height: 1.4;
        word-break: break-word;
    }
    
    .analysis-content {
        padding: 0.3em;
    }
    
    .analysis-item {
        margin-bottom: 0.5em;
        font-size: 0.9em;
        line-height: 1.4;
    }
    
    .analysis-explanation {
        margin-top: 0.5em;
        padding: 0.5em 0.8em;
        font-size: 0.9em;
    }
    
    /* Progress Stats Mobile Layout */
    .progress-stats {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1em;
        margin-bottom: 1em;
    }
    
    .progress-stat {
        text-align: center;
        padding: 0.8em;
        background: #f8fafc;
        border-radius: 8px;
    }
    
    .progress-stat-value {
        font-size: 1.3em;
        margin-bottom: 0.2em;
    }
    
    .progress-stat-label {
        font-size: 0.85em;
    }
    
    /* Mobile-specific spacing adjustments */
    .recent-activity {
        margin-bottom: 1.5em;
    }
    
    .recent-activity h2 {
        font-size: 1.3em;
        margin-bottom: 1em;
    }
    
    .leaderboard-section {
        margin-bottom: 1.5em;
    }
    
    .leaderboard-section h2 {
        font-size: 1.3em;
        text-align: center;
    }
    
    /* Mobile dashboard metrics improvements */
    .dashboard-grid {
        gap: 1em;
        margin-bottom: 1.5em;
    }
    
    .metric-card {
        padding: 1em;
        text-align: center;
    }
    
    .metric-value {
        font-size: 1.8em;
    }
    
    .metric-title {
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    /* Extra small mobile adjustments */
    .progress-stats {
        grid-template-columns: 1fr;
        gap: 0.8em;
    }
    
    .snippet-card {
        padding: 0.8em;
    }
    
    .snippet-url {
        font-size: 0.9em;
    }
    
    .snippet-text {
        font-size: 0.85em;
        padding: 0.5em 0.7em;
    }
    
    .analysis-item {
        font-size: 0.85em;
    }
    
    .metric-card {
        padding: 0.8em;
    }
    
    .metric-value {
        font-size: 1.6em;
    }
}

/* Comprehensive Responsive Breakpoints */

/* Large Desktop (1200px+) */
@media (min-width: 1200px) {
    .container {
        max-width: 1400px;
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .chart-container {
        height: 350px;
    }
}

/* Medium Desktop (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .dashboard-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Small Desktop / Large Tablet (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .header {
        padding: 1.5em 2em;
    }
    
    .metric-card {
        padding: 1.5em 1.2em;
    }
}

/* Tablet Portrait (600px - 767px) */
@media (min-width: 600px) and (max-width: 767px) {
    .left-nav {
        width: 180px;
    }
    
    .header, .dashboard-grid, #progress, .recent-activity, .leaderboard-section {
        margin-left: 180px !important;
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.2em;
    }
    
    .progress-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile Landscape (480px - 599px) */
@media (min-width: 480px) and (max-width: 599px) {
    .header {
        padding: 1.2em;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1em;
    }
    
    .progress-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8em;
    }
}

/* Mobile Portrait (max 479px) */
@media (max-width: 479px) {
    .header {
        padding: 1em;
        text-align: center;
    }
    
    .tux-logo {
        max-width: 60px;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    .subtitle {
        font-size: 1em;
    }
    
    .progress-stats {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        height: 200px;
    }
}

/* High DPI / Retina Display Optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hamburger-line {
        height: 2px; /* Thinner lines on high DPI displays */
    }
    
    .mobile-nav-toggle {
        box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    }
}

/* Landscape Orientation Specific */
@media (orientation: landscape) and (max-height: 600px) {
    .header {
        padding: 1em 2em;
    }
    
    .chart-container {
        height: 200px;
    }
    
    .mobile-nav-toggle {
        top: 0.5rem;
        left: 0.5rem;
        width: 40px;
        height: 40px;
    }
}
