* {
    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;
    padding: 20px;
}

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

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

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

h1 {
    color: #333;
    font-size: 2em;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
}

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

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

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-success {
    background: #28a745;
    color: white;
    width: 100%;
    margin-bottom: 10px;
}

.btn-back {
    background: #f0f0f0;
    color: #333;
}

/* Vinyl Grid */
.vinyl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.vinyl-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    position: relative;
}

.vinyl-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0,0,0,0.2);
}

.vinyl-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.vinyl-info {
    padding: 15px;
}

.vinyl-info h3 {
    font-size: 1.1em;
    margin-bottom: 5px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vinyl-info .artist {
    color: #666;
    font-size: 0.9em;
}

.vinyl-info .year {
    color: #999;
    font-size: 0.85em;
    margin-top: 5px;
}

.btn-delete {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(220,53,69,0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-delete:hover {
    background: #dc3545;
    transform: scale(1.1);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state h2 {
    color: #666;
    margin-bottom: 10px;
}

.empty-state p {
    color: #999;
    margin-bottom: 20px;
}

/* Scanner */
.scanner-section {
    max-width: 600px;
    margin: 0 auto;
}

#scanner-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto 20px;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

#video {
    width: 100%;
    height: auto;
    display: block;
}

#scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.scanner-line {
    width: 80%;
    height: 2px;
    background: #00ff00;
    box-shadow: 0 0 10px #00ff00;
    animation: scan 2s infinite;
}

@keyframes scan {
    0%, 100% { transform: translateY(-100px); }
    50% { transform: translateY(100px); }
}

.controls {
    text-align: center;
    margin: 20px 0;
}

.controls .btn {
    margin: 0 5px;
}

.manual-input {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.manual-input p {
    margin-bottom: 10px;
    color: #666;
}

.input-group {
    display: flex;
    gap: 10px;
    max-width: 400px;
    margin: 0 auto;
}

.input-group input {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}

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

/* Album Card */
.album-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.album-card img {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: 8px;
    margin: 0 auto 20px;
    display: block;
}

.album-info {
    margin-bottom: 20px;
}

.album-info h2 {
    color: #333;
    margin-bottom: 15px;
}

.album-info p {
    color: #666;
    margin: 8px 0;
}

.album-actions .btn {
    width: 100%;
    margin-bottom: 10px;
}

/* Loading */
#loading {
    text-align: center;
    padding: 40px;
}

.loader {
    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); }
}

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

    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    h1 {
        font-size: 1.5em;
    }

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

    .vinyl-card img {
        height: 150px;
    }
}

/* Vinyl Card Link */
.vinyl-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.vinyl-link:hover {
    text-decoration: none;
}

.vinyl-card {
    cursor: pointer;
}

/* Detail Page */
.detail-page {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 30px;
}

.detail-cover {
    text-align: center;
}

.detail-cover img {
    width: 100%;
    max-width: 500px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.detail-info h1 {
    font-size: 2.5em;
    margin-bottom: 30px;
    color: #333;
}

.info-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.info-section:last-child {
    border-bottom: none;
}

.info-section h3 {
    color: #999;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.info-section p {
    font-size: 1.2em;
    color: #333;
}

.info-section code {
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 1.1em;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

/* Tracklist */
.tracklist-section {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 2px solid #f0f0f0;
}

.tracklist-section h2 {
    color: #333;
    margin-bottom: 20px;
}

.tracklist {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
}

.track-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: white;
    border-radius: 8px;
    transition: all 0.3s;
}

.track-item:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.track-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.track-position {
    font-weight: 600;
    color: #999;
    min-width: 30px;
}

.track-title {
    font-weight: 500;
    color: #333;
    flex: 1;
}

.track-duration {
    color: #999;
    font-size: 0.9em;
}

.spotify-link {
    padding: 8px 16px;
    background: #1DB954;
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s;
    white-space: nowrap;
}

.spotify-link:hover {
    background: #1ed760;
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .detail-page {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .detail-info h1 {
        font-size: 1.8em;
    }

    .track-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .track-info {
        width: 100%;
    }

    .spotify-link {
        width: 100%;
        text-align: center;
    }
}
