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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5e6d3 0%, #e8d5c4 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 1200px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: #2d2d2d;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    font-weight: 700;
    letter-spacing: -1px;
}

.subtitle {
    font-size: 1.1rem;
    color: #6b5b4e;
    font-style: italic;
    margin-bottom: 20px;
}

.collection-link {
    display: inline-block;
    background: linear-gradient(135deg, #4ecdc4 0%, #44af9d 100%);
    color: white;
    padding: 10px 24px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.3);
}

.collection-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.4);
}

.main-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    margin-bottom: 40px;
    position: relative;
    align-items: center;
}
.player-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

/* ==================== SPEAKERS ==================== */
.speaker {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.speaker-left {
    left: 20px;
}

.speaker-right {
    right: 20px;
}

.speaker-body {
    width: 140px;
    height: 180px;
    background: linear-gradient(135deg, #3e3e3e 0%, #1a1a1a 100%);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 25px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
    position: relative;
}

.speaker-cone {
    width: 90px;
    height: 90px;
    background: radial-gradient(circle at 30% 30%, #555, #222);
    border-radius: 50%;
    box-shadow: inset 0 6px 12px rgba(0, 0, 0, 0.6);
}

.speaker-center {
    width: 24px;
    height: 24px;
    background: #d4af37;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.musical-note {
    font-size: 3rem;
    color: #ff6b6b;
    opacity: 0;
    position: absolute;
    font-weight: bold;
}

.note-1 {
    right: -30px;
    top: 15px;
}

.note-2 {
    right: -70px;
    top: 40px;
}

.musical-note.playing {
    animation: bounce-note 0.8s ease-in-out infinite;
}

@keyframes bounce-note {
    0% {
        opacity: 0;
        transform: translateX(0) translateY(0);
    }
    25% {
        opacity: 1;
    }
    50% {
        opacity: 1;
        transform: translateX(20px) translateY(-15px);
    }
    75% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateX(40px) translateY(-30px);
    }
}

#noteLeft1 {
    animation-delay: 0s;
}

#noteLeft2 {
    animation-delay: 0.2s;
}

#noteRight1 {
    animation-delay: 0s;
    left: -30px;
    transform: scaleX(-1);
}

#noteRight2 {
    animation-delay: 0.2s;
    left: -70px;
    transform: scaleX(-1);
}

.player-base {
    position: relative;
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #3e3e3e 0%, #2a2a2a 100%);
    border-radius: 20px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        inset 0 0 30px rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Record */
.record {
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: #1a1a1a;
    box-shadow: 
        0 0 30px rgba(0, 0, 0, 0.8),
        inset 0 0 20px rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.record.playing {
    animation: spin 3s linear infinite;
}

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

.record-vinyl {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: 
        repeating-radial-gradient(
            circle at center,
            transparent 0px,
            transparent 2px,
            rgba(255, 255, 255, 0.03) 2px,
            rgba(255, 255, 255, 0.03) 4px
        );
    pointer-events: none;
}

.record-center {
    position: relative;
    width: 140px;
    height: 140px;
    background: radial-gradient(circle at 30% 30%, #d4af37, #8b7500);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.4),
        inset 0 2px 4px rgba(255, 255, 255, 0.2);
}

.album-art {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #b19cd9 0%, #7b68ee 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: visible;
    position: relative;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
}

.album-art img {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    border-radius: 50%;
}

.album-placeholder {
    font-size: 3rem;
    color: white;
    opacity: 0.6;
}

/* Tonearm */
.tonearm {
    position: absolute;
    width: 200px;
    height: 12px;
    background: linear-gradient(90deg, #8b7355 0%, #5d4e37 100%);
    right: 30px;
    top: 50%;
    transform-origin: right center;
    transform: translateY(-50%) rotateZ(0deg);
    cursor: pointer;
    border-radius: 10px 0 0 10px;
    transition: transform 0.6s ease-in-out;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.tonearm:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.tonearm.playing {
    transform: translateY(-50%) rotateZ(-45deg);
}

.tonearm-head {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    background: radial-gradient(circle at 30% 30%, #ffdfba, #ff9a56);
    border-radius: 50%;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

/* Controls */
.controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    align-items: center;
}

.upload-section {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.file-input {
    display: none;
}

.upload-label {
    cursor: pointer;
}

.upload-button {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    border: none;
}

.upload-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.upload-button-secondary {
    background: linear-gradient(135deg, #4ecdc4 0%, #44af9d 100%);
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.3);
}

.upload-button-secondary:hover {
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.4);
}

.status-display {
    text-align: center;
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 300px;
}

.status-display p {
    margin: 8px 0;
    color: #2d2d2d;
}

#songName {
    font-weight: 700;
    font-size: 1.1rem;
    color: #ff6b6b;
}

#playStatus {
    font-size: 0.95rem;
    color: #6b5b4e;
    font-style: italic;
}

.record-button {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-load {
    background: #4ecdc4;
    color: white;
}

.btn-load:hover {
    background: #2db8a7;
    transform: scale(1.05);
}

.btn-delete {
    background: #ffb3ba;
    color: white;
}

.btn-delete:hover {
    background: #ff8a95;
    transform: scale(1.05);
}

.btn-save {
    background: #95e1d3;
    color: white;
    padding: 10px 25px;
    font-size: 0.95rem;
}

.btn-save:hover {
    background: #6dbfb5;
    transform: translateY(-2px);
}

.btn-save:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Save button container (if added to controls) */
.save-button-container {
    width: 100%;
}

/* ==================== COLLECTION PAGE STYLES ==================== */
.collection-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.collection-nav {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

.nav-button {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
    padding: 10px 24px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.nav-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.collection-stats {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 20px 0;
}

.stat-box {
    background: linear-gradient(135deg, #f9f5f0 0%, #f5ede7 100%);
    padding: 30px 60px;
    border-radius: 15px;
    border-left: 4px solid #ff6b6b;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: #ff6b6b;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 1rem;
    color: #6b5b4e;
    font-weight: 600;
}

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

.collection-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.collection-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.collection-card-art {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(135deg, #f5e6d3 0%, #e8d5c4 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.collection-card .album-art {
    width: 100%;
    height: 100%;
    border-radius: 0;
}

.collection-card-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-grow: 1;
}

.collection-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #2d2d2d;
    word-break: break-word;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.collection-card-date {
    font-size: 0.8rem;
    color: #999;
    margin-top: auto;
}

.collection-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.collection-card-actions .record-button {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.8rem;
}

/* ==================== SAVED RECORDS SECTION (old main page) ==================== */
.saved-records-section {
    display: none;
}

.saved-records-section h2 {
    color: #2d2d2d;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.records-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.empty-message {
    color: #999;
    text-align: center;
    padding: 30px;
    font-style: italic;
}

.record-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f9f5f0 0%, #f5ede7 100%);
    padding: 15px;
    border-radius: 12px;
    border-left: 4px solid #ff6b6b;
    transition: all 0.3s ease;
    cursor: pointer;
}

.record-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.2);
}

.record-item-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.record-item-name {
    font-weight: 600;
    color: #2d2d2d;
    font-size: 1rem;
}

.record-item-date {
    font-size: 0.85rem;
    color: #999;
}

.record-item-actions {
    display: flex;
    gap: 10px;
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    header h1 {
        font-size: 2.5rem;
    }

    .player-base {
        width: 350px;
        height: 350px;
    }

    .record {
        width: 280px;
        height: 280px;
    }

    .collection-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .player-base {
        width: 280px;
        height: 280px;
    }

    .record {
        width: 220px;
        height: 220px;
    }

    .tonearm {
        width: 150px;
        right: 20px;
    }

    .status-display {
        min-width: 250px;
    }

    .saved-records-section {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .player-base {
        width: 240px;
        height: 240px;
    }

    .record {
        width: 180px;
        height: 180px;
    }

    .tonearm {
        width: 100px;
        right: 15px;
    }

    .status-display {
        min-width: 100%;
    }
}

/* ==================== SETTINGS PAGE ==================== */
.settings-container {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.settings-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.settings-section h2 {
    color: #2d2d2d;
    font-size: 1.5rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.setting-item {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.setting-item:last-child {
    margin-bottom: 0;
}

.setting-item label {
    color: #2d2d2d;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.setting-item input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
}

.setting-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4ecdc4;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.setting-item input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4ecdc4;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.setting-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #4ecdc4;
}

.setting-item select {
    padding: 12px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    background: white;
    font-size: 1rem;
    cursor: pointer;
    color: #2d2d2d;
    transition: border-color 0.3s ease;
}

.setting-item select:focus {
    outline: none;
    border-color: #4ecdc4;
}

.setting-item span {
    color: #6b5b4e;
    font-weight: 600;
    min-width: 50px;
}

.setting-description {
    color: #6b5b4e;
    font-size: 0.9rem;
    margin-top: 5px;
}

.about-text {
    color: #6b5b4e;
    margin-bottom: 10px;
    line-height: 1.6;
}

.btn-secondary {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(127, 140, 141, 0.4);
}

/* ==================== COLOR THEMES ==================== */

/* Default Theme (Classic Beige) */
body.theme-default {
    background: linear-gradient(135deg, #f5e6d3 0%, #e8d5c4 100%) !important;
}

/* Dark Mode Theme */
body.theme-dark {
    background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%) !important;
}

body.theme-dark header h1,
body.theme-dark .subtitle,
body.theme-dark .collection-stats,
body.theme-dark .stat-label,
body.theme-dark .stat-number {
    color: #ecf0f1 !important;
}

body.theme-dark .player-base {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
}

body.theme-dark .settings-section,
body.theme-dark .collection-card {
    background: #34495e !important;
    color: #ecf0f1;
}

body.theme-dark .settings-section h2,
body.theme-dark .setting-item label,
body.theme-dark .about-text,
body.theme-dark .setting-description {
    color: #ecf0f1 !important;
}

/* Retro Orange Theme */
body.theme-retro {
    background: linear-gradient(135deg, #ff9a56 0%, #ff6b35 100%) !important;
}

body.theme-retro header h1 {
    color: #ffffff !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

body.theme-retro .subtitle {
    color: #ffe8d6 !important;
}

body.theme-retro .player-base {
    background: linear-gradient(135deg, #ff8243 0%, #ff5722 100%);
}

body.theme-retro .collection-link {
    background: linear-gradient(135deg, #ff5722 0%, #f4511e 100%);
}

body.theme-retro .settings-section,
body.theme-retro .collection-card {
    background: #ffd4a3 !important;
}

/* Midnight Blue Theme */
body.theme-midnight {
    background: linear-gradient(135deg, #1e3a5f 0%, #0f2342 100%) !important;
}

body.theme-midnight header h1,
body.theme-midnight .subtitle {
    color: #a8d8ea !important;
}

body.theme-midnight .player-base {
    background: linear-gradient(135deg, #2c5f8d 0%, #1e3a5f 100%);
}

body.theme-midnight .collection-link {
    background: linear-gradient(135deg, #5499c7 0%, #2e86ab 100%);
}

body.theme-midnight .settings-section,
body.theme-midnight .collection-card {
    background: #2c5f8d !important;
    color: #ecf0f1;
}

body.theme-midnight .settings-section h2,
body.theme-midnight .setting-item label,
body.theme-midnight .about-text,
body.theme-midnight .setting-description,
body.theme-midnight .stat-label,
body.theme-midnight .stat-number {
    color: #a8d8ea !important;
}

/* Forest Green Theme */
body.theme-forest {
    background: linear-gradient(135deg, #52796f 0%, #354f52 100%) !important;
}

body.theme-forest header h1 {
    color: #cad2c5 !important;
}

body.theme-forest .subtitle {
    color: #84a98c !important;
}

body.theme-forest .player-base {
    background: linear-gradient(135deg, #52796f 0%, #2f3e46 100%);
}

body.theme-forest .collection-link {
    background: linear-gradient(135deg, #84a98c 0%, #52796f 100%);
}

body.theme-forest .settings-section,
body.theme-forest .collection-card {
    background: #84a98c !important;
    color: #2f3e46;
}

body.theme-forest .settings-section h2,
body.theme-forest .setting-item label {
    color: #2f3e46 !important;
}

body.theme-forest .about-text,
body.theme-forest .setting-description {
    color: #354f52 !important;
}
