/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Crimson Text', serif;
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 25%, #fab1a0 50%, #ff7675 75%, #fd79a8 100%);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 20px;
    color: #2d3436;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    padding: 40px;
    backdrop-filter: blur(10px);
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 3px solid #fdcb6e;
}

h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 3.5rem;
    font-weight: 700;
    color: #e17055;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 1.5rem;
    color: #636e72;
    font-style: italic;
}

/* Controls */
.controls {
    margin-bottom: 40px;
}

/* Instrument Selector */
.instrument-selector {
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.instrument-selector label {
    font-size: 1.2rem;
    font-weight: 600;
    color: #e17055;
}

#myInstrument {
    padding: 10px 20px;
    font-size: 1.1rem;
    font-family: 'Crimson Text', serif;
    border: 3px solid #fdcb6e;
    border-radius: 50px;
    background: white;
    color: #e17055;
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
}

#myInstrument:focus {
    border-color: #e17055;
    box-shadow: 0 0 20px rgba(225, 112, 85, 0.3);
}

.remember-choice {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    color: #636e72;
    cursor: pointer;
}

#rememberInstrument {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.search-box {
    position: relative;
    margin-bottom: 25px;
}

#searchInput {
    width: 100%;
    padding: 15px 50px 15px 20px;
    font-size: 1.2rem;
    font-family: 'Crimson Text', serif;
    border: 3px solid #fdcb6e;
    border-radius: 50px;
    outline: none;
    transition: all 0.3s ease;
    background: #fffef7;
}

#searchInput:focus {
    border-color: #e17055;
    box-shadow: 0 0 20px rgba(225, 112, 85, 0.3);
    transform: translateY(-2px);
}

.search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    pointer-events: none;
}

/* Filters */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.filter-btn {
    padding: 12px 28px;
    font-size: 1.1rem;
    font-family: 'Crimson Text', serif;
    font-weight: 600;
    border: 3px solid #fdcb6e;
    background: white;
    color: #e17055;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.filter-btn:hover {
    background: #fff5e6;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(225, 112, 85, 0.3);
}

.filter-btn.active {
    background: linear-gradient(135deg, #e17055, #fd79a8);
    color: white;
    border-color: #e17055;
    box-shadow: 0 5px 20px rgba(225, 112, 85, 0.4);
}

.filter-btn:active {
    transform: translateY(-1px);
}

/* Piece Count */
.piece-count {
    text-align: center;
    font-size: 1.2rem;
    color: #636e72;
    margin-bottom: 30px;
    font-style: italic;
}

/* Pieces List */
.pieces-list {
    display: grid;
    gap: 25px;
}

.piece-card {
    background: white;
    border: 3px solid #fdcb6e;
    border-radius: 15px;
    padding: 25px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.piece-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #e17055;
}

.piece-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #fdcb6e;
    gap: 15px;
    flex-wrap: wrap;
}

.piece-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2rem;
    font-weight: 600;
    color: #e17055;
    margin: 0;
}

.instrument-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.instrument-badge-inline {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

.piece-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.download-button {
    display: inline-block;
    padding: 15px 30px;
    background: #e17055;
    color: white;
    border-radius: 50px;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(225, 112, 85, 0.3);
    border: none;
    cursor: pointer;
    flex: 1;
    text-align: center;
}

.download-button:hover {
    background: #d35d48;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(225, 112, 85, 0.4);
}

.share-button {
    display: inline-block;
    padding: 15px 30px;
    background: #2d3436;
    color: white;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(45, 52, 54, 0.3);
    border: none;
    cursor: pointer;
    font-family: 'Crimson Text', serif;
}

.share-button:hover {
    background: #1a1d1f;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(45, 52, 54, 0.4);
}

.piece-header-with-share {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #fdcb6e;
    gap: 15px;
}

.share-button-small {
    padding: 8px 16px;
    background: #2d3436;
    color: white;
    border-radius: 50%;
    font-size: 1.2rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(45, 52, 54, 0.3);
    flex-shrink: 0;
}

.share-button-small:hover {
    background: #1a1d1f;
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(45, 52, 54, 0.4);
}

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

.instrument-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    background: white;
    border: 2px solid #74b9ff;
    border-radius: 10px;
    text-decoration: none;
    color: #0984e3;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.instrument-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(116, 185, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.instrument-link:hover::before {
    left: 100%;
}

.instrument-link:hover {
    background: #0984e3;
    color: white;
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(9, 132, 227, 0.3);
}

.instrument-link::after {
    content: ' 📄';
    margin-left: 8px;
}

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

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.empty-state-text {
    font-size: 1.5rem;
    font-family: 'Cormorant Garamond', serif;
}

/* Footer */
footer {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 3px solid #fdcb6e;
    text-align: center;
    color: #636e72;
    font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 20px;
    }

    h1 {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1.2rem;
    }

    .instrument-selector {
        flex-direction: column;
        align-items: flex-start;
    }

    #myInstrument {
        width: 100%;
    }

    .filters {
        gap: 10px;
    }

    .filter-btn {
        padding: 10px 20px;
        font-size: 1rem;
    }

    .piece-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .piece-title {
        font-size: 1.6rem;
    }

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

    .piece-actions {
        flex-direction: column;
    }

    .download-button,
    .share-button {
        width: 100%;
        text-align: center;
    }
}

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

    .subtitle {
        font-size: 1rem;
    }

    .filters {
        flex-direction: column;
    }

    .filter-btn {
        width: 100%;
    }
}

/* Loading Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.piece-card {
    animation: fadeIn 0.5s ease forwards;
}

.piece-card:nth-child(1) { animation-delay: 0.05s; }
.piece-card:nth-child(2) { animation-delay: 0.1s; }
.piece-card:nth-child(3) { animation-delay: 0.15s; }
.piece-card:nth-child(4) { animation-delay: 0.2s; }
.piece-card:nth-child(5) { animation-delay: 0.25s; }
