/* Reset and Base Styles */
* {
    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, #2c3e50 0%, #34495e 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    margin-bottom: 40px;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    box-shadow: 0 5px 15px rgba(255, 140, 0, 0.3);
}

.header-text {
    text-align: center;
}

.header h1 {
    font-size: 3rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 0;
}

/* Search Section */
.search-section {
    margin-bottom: 30px;
}

.options-section {
    display: flex;
    justify-content: center;
    margin: 15px 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    position: relative;
    width: 20px;
    height: 20px;
    appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked {
    background: #e67e22;
    border-color: #e67e22;
}

.checkbox-label input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-label:hover input[type="checkbox"] {
    border-color: #e67e22;
    transform: scale(1.05);
}

.search-container {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-collection-preview {
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.search-preview-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    border: 2px solid rgba(230, 126, 34, 0.3);
}

.search-input {
    flex: 1;
    max-width: 400px;
    padding: 16px 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #e67e22;
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(230, 126, 34, 0.3);
}

.load-button {
    padding: 16px 32px;
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    color: white;
    border: 2px solid #d35400;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 180px;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(211, 84, 0, 0.3);
}

.load-button:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(211, 84, 0, 0.5);
    background: linear-gradient(135deg, #d35400 0%, #bf4f07 100%);
}

.load-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.popular-collections {
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    color: rgba(255, 255, 255, 0.9);
}

.collection-tag {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.collection-tag:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.hiscores-button {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%) !important;
    color: white !important;
    border: 1px solid #d35400 !important;
    font-weight: 600;
}

.hiscores-button:hover {
    background: linear-gradient(135deg, #d35400 0%, #bf4f07 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(211, 84, 0, 0.4);
}

/* Status Messages */
.status-message {
    margin: 20px 0;
    padding: 15px 20px;
    border-radius: 10px;
    text-align: center;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.status-message.success {
    background: rgba(46, 213, 115, 0.9);
    color: white;
    border: 1px solid rgba(46, 213, 115, 0.5);
}

.status-message.error {
    background: rgba(255, 71, 87, 0.9);
    color: white;
    border: 1px solid rgba(255, 71, 87, 0.5);
}

.status-message.loading {
    background: rgba(102, 126, 234, 0.9);
    color: white;
    border: 1px solid rgba(102, 126, 234, 0.5);
}

/* Stats Section */
.stats-section {
    margin-bottom: 30px;
}

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

.stat-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    border-left: 4px solid #e67e22;
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Chart Section */
.chart-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    margin-bottom: 30px;
    flex: 1;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.chart-title-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 1;
}

.chart-header h3 {
    color: #333;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.collection-preview {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(230, 126, 34, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(230, 126, 34, 0.2);
}

.preview-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.preview-info {
    flex: 1;
}

.preview-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.preview-description {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
}

.chart-controls {
    display: flex;
    gap: 10px;
}

.download-button, .toggle-button {
    padding: 10px 20px;
    border: 2px solid #e67e22;
    border-radius: 8px;
    background: transparent;
    color: #e67e22;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.download-button:hover, .toggle-button:hover {
    background: #e67e22;
    color: white;
    transform: translateY(-2px);
}

.chart-container {
    position: relative;
    height: 500px;
}

/* Info Section */
.info-section {
    margin-bottom: 30px;
}

.info-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.info-card h4 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.info-card ul {
    list-style: none;
    padding: 0;
}

.info-card li {
    margin-bottom: 8px;
    color: #666;
    padding-left: 20px;
    position: relative;
}

.info-card li:before {
    content: "•";
    color: #e67e22;
    font-size: 1.2rem;
    position: absolute;
    left: 0;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin-top: auto;
}

.footer a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer a:hover {
    color: white;
    text-decoration: underline;
}

/* Hiscores Section */
.hiscores-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    margin-bottom: 30px;
}

.hiscores-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 30px;
}

.hiscores-header-left {
    flex: 1;
}

.hiscores-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.hiscores-header h3 {
    color: #333;
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.hiscores-subtitle {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.hiscores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.hiscore-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid #e67e22;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.hiscore-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.hiscore-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.hiscore-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}

.hiscore-name {
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
}

.hiscore-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.hiscore-stat {
    text-align: center;
}

.hiscore-stat-value {
    font-weight: 600;
    color: #e67e22;
    font-size: 0.9rem;
}

.hiscore-stat-label {
    color: #666;
    font-size: 0.8rem;
}

.hiscore-performance {
    text-align: center;
    padding: 10px;
    background: rgba(230, 126, 34, 0.1);
    border-radius: 8px;
    margin-top: 10px;
}

.hiscore-performance-score {
    font-weight: 700;
    color: #e67e22;
    font-size: 1.1rem;
}

.hiscore-performance-label {
    color: #666;
    font-size: 0.8rem;
}

.hiscore-performance-score.positive {
    color: #27ae60;
}

.hiscore-performance-score.negative {
    color: #e74c3c;
}

/* Hiscores Header Controls */
.hiscores-header-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.hiscores-pagination-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Hiscores List */
.hiscores-list {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.hiscores-list-header {
    display: grid;
    grid-template-columns: 60px 50px 1fr 140px 120px 140px;
    align-items: center;
    padding: 12px 20px;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    gap: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hiscore-header-avg-usd,
.hiscore-header-data-points,
.hiscore-header-gradient {
    text-align: right;
}

.hiscore-list-item {
    display: grid;
    grid-template-columns: 60px 50px 1fr 140px 120px 140px;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s ease;
    gap: 20px;
}

.hiscore-list-item:last-child {
    border-bottom: none;
}

.hiscore-list-item:hover {
    background-color: #f8f9fa;
}

.hiscore-rank {
    font-weight: bold;
    color: #e67e22;
    font-size: 1.1rem;
}

.hiscore-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1rem;
}

.hiscore-avg-usd {
    font-weight: 500;
    color: #27ae60;
    text-align: right;
}

.hiscore-data-points {
    color: #666;
    font-size: 0.9rem;
    text-align: right;
}

.hiscore-gradient {
    font-weight: bold;
    font-family: 'Courier New', monospace;
    text-align: right;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(0,0,0,0.05);
}

.hiscore-gradient.positive {
    color: #27ae60;
    background: rgba(39, 174, 96, 0.1);
}

.hiscore-gradient.negative {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

.hiscore-image {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid #f0f0f0;
}

/* Removed hiscore-image-placeholder - now using default logo image */

.hiscores-pagination-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
}

.hiscores-pagination-nav button {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    color: #333;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.hiscores-pagination-nav button:hover:not(:disabled) {
    background: #f5f5f5;
    border-color: #e67e22;
}

.hiscores-pagination-nav button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.hiscores-pagination-nav span {
    font-size: 14px;
    color: #666;
    margin: 0 10px;
}

.hiscores-info {
    color: #666;
    font-size: 0.9rem;
}

.hiscores-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.hiscores-per-page {
    padding: 8px 16px;
    border: 2px solid #e67e22;
    border-radius: 6px;
    background: transparent;
    color: #e67e22;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hiscores-per-page:hover {
    background: #e67e22;
    color: white;
}

.hiscores-per-page.active {
    background: #e67e22;
    color: white;
}

.hiscores-pagination {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hiscores-pagination button {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    color: #333;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.hiscores-pagination button:hover:not(:disabled) {
    background: #f5f5f5;
    border-color: #e67e22;
}

.hiscores-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.hiscores-pagination span {
    font-size: 14px;
    color: #666;
    margin: 0 5px;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .header h1 {
        font-size: 2.2rem;
    }

    .search-container {
        flex-direction: column;
        align-items: stretch;
    }

    .search-input {
        max-width: none;
    }

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

    .chart-header {
        flex-direction: column;
        align-items: stretch;
    }

    .collection-preview {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .preview-image {
        align-self: center;
    }

    .chart-controls {
        justify-content: center;
    }

    .chart-container {
        height: 400px;
    }

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

    .hiscores-header {
        flex-direction: column;
        gap: 15px;
    }

    .hiscores-header-right {
        justify-content: center;
        flex-wrap: wrap;
    }

    .hiscores-list-header {
        grid-template-columns: 30px 30px 1fr 80px;
        gap: 10px;
        padding: 10px 15px;
        font-size: 0.8rem;
    }

    .hiscore-header-avg-usd,
    .hiscore-header-data-points {
        display: none;
    }

    .hiscore-list-item {
        grid-template-columns: 30px 30px 1fr 80px;
        gap: 10px;
        padding: 12px 15px;
    }

    .hiscore-avg-usd,
    .hiscore-data-points {
        display: none;
    }

    .hiscore-gradient {
        font-size: 0.8rem;
    }

    .hiscore-image {
        width: 30px;
        height: 30px;
    }

    .hiscores-pagination-controls {
        flex-wrap: wrap;
        gap: 10px;
    }

    .hiscore-card {
        padding: 15px;
    }

    .hiscores-header h3 {
        font-size: 1.5rem;
    }
}