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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    opacity: 0.9;
    font-size: 1.1em;
}

/* Market Statistics Section */
.market-stats {
    padding: 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.market-stats h2 {
    margin-bottom: 20px;
    color: #333;
}

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

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-label {
    font-size: 0.9em;
    color: #6c757d;
    margin-bottom: 10px;
}

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

.stat-change {
    font-size: 1.2em;
    margin-top: 10px;
    font-weight: 600;
}

.stat-change.positive {
    color: #28a745;
}

.stat-change.negative {
    color: #dc3545;
}

/* Top Movers Section */
.top-movers {
    padding: 30px;
    background: white;
}

.movers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.gainers, .losers {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.gainers h3 {
    color: #28a745;
    margin-bottom: 15px;
}

.losers h3 {
    color: #dc3545;
    margin-bottom: 15px;
}

.compact-table {
    width: 100%;
}

.compact-table tr {
    border-bottom: 1px solid #e0e0e0;
}

.compact-table td {
    padding: 10px;
}

.compact-table td:last-child {
    text-align: right;
    font-weight: bold;
}

/* Main Table Section */
.main-table {
    padding: 30px;
}

.main-table h2 {
    margin-bottom: 20px;
    color: #333;
}

.table-info {
    background: #e7f3ff;
    border-left: 4px solid #007bff;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
}

.table-info p {
    margin-bottom: 10px;
    color: #333;
}

.table-info ul {
    margin-left: 20px;
    color: #666;
}

.table-info li {
    margin: 5px 0;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.hosting-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.hosting-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.hosting-table th {
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    white-space: nowrap;
    position: sticky;
    top: 0;
}

.group-header {
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.hosting-table th.atomic {
    background: rgba(0, 0, 0, 0.1);
    font-size: 0.9em;
}

.hosting-table th.period {
    background: rgba(255, 255, 255, 0.1);
    font-size: 0.9em;
}

.hosting-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.2s;
}

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

.hosting-table tbody tr.top3 {
    background: linear-gradient(90deg, #fff9e6 0%, white 100%);
}

.hosting-table td {
    padding: 10px 8px;
    text-align: center;
}

.position {
    font-weight: bold;
    color: #666;
    font-size: 1.1em;
}

.medal {
    font-size: 1.5em;
}

.hosting-name {
    text-align: left !important;
    font-weight: 600;
}

.hosting-name a {
    color: #007bff;
    text-decoration: none;
}

.hosting-name a:hover {
    text-decoration: underline;
}

.domains {
    font-weight: 600;
    color: #333;
}

.market-share {
    color: #666;
}

.change-cell {
    white-space: nowrap;
}

.change-cell.atomic {
    background: rgba(0, 0, 0, 0.02);
}

.change-cell.period {
    background: rgba(102, 126, 234, 0.05);
}

.positive {
    color: #28a745;
    font-weight: 600;
}

.negative {
    color: #dc3545;
    font-weight: 600;
}

.neutral {
    color: #6c757d;
}

.position-change {
    font-size: 0.85em;
    color: #999;
    margin-left: 3px;
}

/* Footer */
footer {
    padding: 20px;
    background: #f8f9fa;
    text-align: center;
    color: #666;
}

footer a {
    color: #007bff;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        border-radius: 0;
    }

    header h1 {
        font-size: 1.8em;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .hosting-table {
        font-size: 0.85em;
    }

    .hosting-table td, .hosting-table th {
        padding: 8px 4px;
    }

    .change-cell {
        font-size: 0.8em;
    }

    .position-change {
        display: block;
        margin-left: 0;
    }
}

/* Loading Animation */
@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

.loading {
    animation: pulse 1.5s infinite;
}

/* Tooltips */
[title] {
    position: relative;
    cursor: help;
}

[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    white-space: nowrap;
    font-size: 0.85em;
    z-index: 1000;
}