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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.content-section {
    background: white;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header {
    background: white;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header h1 {
    color: #333;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.header p {
    color: #666;
    font-size: 1.1em;
}

.version-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    text-decoration: none;
    display: inline-block;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.version-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    color: white;
}

.back-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    margin-top: 10px;
    text-decoration: none;
    display: inline-block;
    transition: background 0.3s ease;
}

.back-btn:hover {
    background: #5568d3;
}

.stats-card {
    background: white;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    box-sizing: border-box;
}

.stats-card h2 {
    color: #333;
    font-size: 1.8em;
    margin-bottom: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 8px;
}

.stat-label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.5em;
    font-weight: bold;
    color: #333;
}

.frequency-table-container {
    background: white;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    width: 100%;
    box-sizing: border-box;
}

.frequency-table-container h2 {
    color: #333;
    font-size: 1.8em;
    margin-bottom: 20px;
}

.frequency-table-container h3,
.tier-title {
    color: #667eea;
    font-size: 1.3em;
    margin-bottom: 15px;
    margin-top: 0;
}

.tier-section {
    margin-bottom: 30px;
}

.tier-section:last-child {
    margin-bottom: 0;
}

.tier-section table {
    margin: 0;
    width: 100%;
}

.visual-bar {
    background: #667eea;
    height: 20px;
    border-radius: 3px;
    min-width: 2px;
}

.frequency-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.frequency-table th {
    background: #667eea;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    position: relative;
    cursor: help;
}

.frequency-table th[title]:hover::after {
    content: attr(title);
    position: absolute;
    left: 50%;
    bottom: 100%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.85em;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    pointer-events: none;
}

.frequency-table th[title]:hover::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 100%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    z-index: 1001;
    margin-bottom: -5px;
    pointer-events: none;
}

.frequency-table th:nth-child(3),
.frequency-table td:nth-child(3) {
    text-align: right;
}

.frequency-table th:nth-child(4),
.frequency-table td:nth-child(4) {
    text-align: right;
}

.frequency-table th:nth-child(5),
.frequency-table td:nth-child(5) {
    text-align: right;
}

.frequency-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
}

.frequency-table tr:hover {
    background: #f5f5f5;
}

.frequency-table tr:nth-child(even) {
    background: #fafafa;
}

.number-cell {
    font-weight: bold;
    color: #667eea;
}

.count-cell {
    text-align: right;
}

.percentage-cell {
    text-align: right;
    color: #666;
}

.chart-container {
    background: white;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    box-sizing: border-box;
}

.chart-container h2 {
    color: #333;
    font-size: 1.8em;
    margin-bottom: 20px;
}

.chart-wrapper {
    position: relative;
    height: 400px;
}

/* Navigation Menu */
.nav-menu {
    background: white;
    border-radius: 10px;
    padding: 15px 30px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #333;
    font-size: 1.5em;
    font-weight: bold;
}

.nav-logo:hover {
    color: #667eea;
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: #f5f5f5;
    color: #333;
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.95em;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.nav-link:hover {
    background: #667eea;
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.nav-link.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.nav-link.active:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3d8a 100%);
}

@media (max-width: 768px) {
    .nav-menu {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .nav-links {
        width: 100%;
        flex-direction: column;
    }
    
    .nav-link {
        width: 100%;
        justify-content: center;
    }
}

.loading {
    text-align: center;
    padding: 50px;
    color: white;
    font-size: 1.2em;
}

.progress-indicator {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin: 20px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.progress-title {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
}

.progress-bar-container {
    width: 100%;
    height: 25px;
    background: #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.85em;
    font-weight: 600;
}

.progress-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.progress-detail-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 5px;
    border-left: 3px solid #667eea;
}

.progress-detail-label {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 5px;
}

.progress-detail-value {
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
}

.error {
    background: #f44336;
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

.patterns-comparison-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 1600px) {
    .patterns-comparison-container {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 1200px) {
    .patterns-comparison-container {
        grid-template-columns: 1fr;
    }
}

/* Theme alignment with login/dashboard infrastructure */
body {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 45%, #0ea5e9 100%) !important;
}

.header,
.content-section,
.stats-card,
.frequency-table-container,
.chart-container,
.nav-menu,
.progress-indicator {
    background: rgba(30, 41, 59, 0.72) !important;
    border: 1px solid rgba(191, 219, 254, 0.5);
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.35) !important;
}

.header h1,
.stats-card h2,
.frequency-table-container h2,
.chart-container h2,
.progress-title,
.nav-logo,
.stat-value {
    color: #f8fbff !important;
}

.header p,
.stat-label,
.percentage-cell,
.refresh-label,
.last-updated,
.progress-detail-label {
    color: #dbeafe !important;
}

.version-badge,
.back-btn,
.progress-bar,
.frequency-table th,
.nav-link.active {
    background: linear-gradient(135deg, #2563eb 0%, #38bdf8 100%) !important;
    color: #eaf8ff !important;
}

.nav-link {
    background: rgba(51, 65, 85, 0.64) !important;
    color: #e2e8f0 !important;
    border: 1px solid rgba(191, 219, 254, 0.5) !important;
}

.nav-link:hover {
    background: rgba(56, 189, 248, 0.18) !important;
    color: #eaf8ff !important;
}

.stat-item,
.progress-detail-item {
    background: rgba(30, 41, 59, 0.5) !important;
    border-color: rgba(191, 219, 254, 0.5) !important;
}

.frequency-table td {
    border-bottom-color: rgba(191, 219, 254, 0.28) !important;
    color: #f1f5f9;
}

.frequency-table tr:hover,
.frequency-table tr:nth-child(even) {
    background: rgba(30, 58, 138, 0.2) !important;
}

.frequency-table th[title]:hover::after {
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.38);
}

.frequency-table th[title]:hover::before {
    border-top-color: rgba(15, 23, 42, 0.96);
}













