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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    max-width: 800px;
    width: 100%;
    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: 28px;
    margin-bottom: 10px;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 14px;
    opacity: 0.9;
}

main {
    padding: 40px;
}

/* Loading Screen */
.loading-screen {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-screen p {
    color: #666;
    font-size: 16px;
}

/* No Products Screen */
.no-products-screen {
    text-align: center;
    padding: 60px 20px;
}

.no-products-screen h2 {
    font-size: 32px;
    margin-bottom: 15px;
    color: #333;
}

.no-products-screen p {
    color: #666;
    font-size: 18px;
    margin-bottom: 30px;
}

/* Product Info */
.product-info {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
}

.product-details {
    margin-bottom: 20px;
}

.product-details:last-of-type {
    margin-bottom: 25px;
}

.label {
    font-size: 12px;
    text-transform: uppercase;
    color: #888;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.value {
    font-size: 20px;
    color: #333;
    font-weight: 600;
}

.btn-copy {
    width: 100%;
    background: #667eea;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-copy:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-copy:active {
    transform: translateY(0);
}

.btn-copy.copied {
    background: #10b981;
}

/* Instructions */
.instructions {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.instructions ol {
    margin-left: 20px;
    color: #856404;
}

.instructions li {
    margin-bottom: 8px;
    line-height: 1.6;
}

/* Upload Area */
.upload-area {
    border: 3px dashed #ddd;
    border-radius: 12px;
    padding: 60px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f5f7ff;
}

.upload-area.dragover {
    border-color: #667eea;
    background: #e8ecff;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.upload-area h3 {
    font-size: 22px;
    color: #333;
    margin-bottom: 10px;
}

.upload-area p {
    color: #666;
    font-size: 16px;
}

.btn-link {
    color: #667eea;
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
    font-size: 16px;
    padding: 0;
}

.btn-link:hover {
    color: #5568d3;
}

.supported-formats {
    margin-top: 15px;
    font-size: 13px;
    color: #999;
}

/* Upload Progress */
.upload-progress {
    text-align: center;
    padding: 60px 30px;
}

.upload-progress p {
    color: #667eea;
    font-size: 16px;
    font-weight: 600;
}

/* Action Buttons */
.action-buttons {
    margin-top: 30px;
    text-align: center;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.3);
}

/* Success Message */
.success-message {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    text-align: center;
    font-weight: 600;
}

/* Error Message */
.error-message {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    text-align: center;
    font-weight: 600;
}

/* Category Progress */
.category-progress {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 1px solid #a5d6a7;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 25px;
}

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

.category-name {
    font-weight: 600;
    color: #2e7d32;
    font-size: 14px;
}

.category-stats {
    font-size: 13px;
    color: #558b2f;
    font-weight: 500;
}

.progress-bar-container {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    height: 12px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #66bb6a 0%, #43a047 100%);
    border-radius: 10px;
    width: 0%;
    transition: width 0.5s ease;
}

/* Leaderboard Panel */
.leaderboard-panel {
    background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
    border: 1px solid #ffca28;
    border-radius: 12px;
    margin-top: 30px;
    overflow: hidden;
}

.leaderboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
    font-weight: 600;
    color: #f57c00;
    transition: background 0.2s;
}

.leaderboard-header:hover {
    background: rgba(255, 193, 7, 0.2);
}

#leaderboard-toggle {
    transition: transform 0.3s;
}

.leaderboard-content {
    max-height: 200px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.leaderboard-content.collapsed {
    max-height: 0;
}

.leaderboard-list {
    padding: 0 20px 15px;
}

.leaderboard-loading {
    text-align: center;
    color: #888;
    padding: 10px;
    font-size: 14px;
}

.leaderboard-entry {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 6px;
    background: white;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.leaderboard-entry.is-you {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
}

.leaderboard-rank {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f5f5f5;
    font-weight: 700;
    font-size: 12px;
    margin-right: 12px;
    color: #666;
}

.leaderboard-entry.is-you .leaderboard-rank {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.leaderboard-rank.gold {
    background: linear-gradient(135deg, #ffd700 0%, #ffb300 100%);
    color: #5d4e00;
}

.leaderboard-rank.silver {
    background: linear-gradient(135deg, #e0e0e0 0%, #bdbdbd 100%);
    color: #424242;
}

.leaderboard-rank.bronze {
    background: linear-gradient(135deg, #ffab91 0%, #ff8a65 100%);
    color: #4e342e;
}

.leaderboard-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leaderboard-count {
    font-weight: 600;
    margin-left: 10px;
}

.leaderboard-empty {
    text-align: center;
    color: #888;
    padding: 15px;
    font-size: 14px;
}

/* Name Entry Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-overlay.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-content h2 {
    font-size: 28px;
    margin-bottom: 10px;
    color: #333;
}

.modal-content p {
    color: #666;
    margin-bottom: 25px;
    font-size: 16px;
}

.modal-content input {
    width: 100%;
    padding: 15px 20px;
    font-size: 18px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    transition: border-color 0.3s;
}

.modal-content input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Responsive */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    
    .container {
        border-radius: 15px;
    }
    
    header {
        padding: 20px;
    }
    
    header h1 {
        font-size: 22px;
    }
    
    main {
        padding: 25px;
    }
    
    .value {
        font-size: 18px;
    }
    
    .upload-area {
        padding: 40px 20px;
    }
}



