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

:root {
    --primary: #6C63FF;
    --primary-dark: #5850e6;
    --secondary: #FF6584;
    --success: #4CAF50;
    --warning: #FFC107;
    --danger: #FF5252;
    --info: #2196F3;
    
    --bg-primary: #f5f7fa;
    --bg-card: #ffffff;
    --bg-hover: #f0f2f5;
    
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --text-muted: #95a5a6;
    
    --border: #e1e8ed;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
    
    --radius: 12px;
    --radius-sm: 8px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--bg-primary);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow-lg);
    min-height: calc(100vh - 40px);
}

/* Credits in header */
.app-credits {
    text-align: center;
    padding: 12px 0 0 0;
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 12px;
    border-top: 1px solid var(--border);
}

.app-credits p {
    margin: 0;
}

.app-credits a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.app-credits a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ==================== HEADER ==================== */

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid var(--primary);
}

header h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

/* ==================== REPERTOIRE TABS ==================== */

.repertoire-tabs {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.tabs {
    display: flex;
    gap: 8px;
    flex: 1;
    flex-wrap: wrap;
}

.tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-hover);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    position: relative;
}

.tab:hover {
    background: #e8eaf0;
    border-color: var(--primary);
}

.tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.tab-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.tab-count {
    background: rgba(0,0,0,0.1);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: bold;
}

.tab.active .tab-count {
    background: rgba(255,255,255,0.2);
}

.tab-edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.6;
    transition: opacity 0.2s;
    padding: 2px 4px;
}

.tab-edit-btn:hover {
    opacity: 1;
}

.tab.active .tab-edit-btn {
    opacity: 0.8;
}

.tab.active .tab-edit-btn:hover {
    opacity: 1;
}

.repertoire-tabs .btn-small {
    padding: 8px 14px;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* ==================== OVERALL PROGRESS ==================== */

.overall-progress {
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
    text-align: center;
}

.overall-progress h3 {
    margin-bottom: 15px;
    color: var(--primary);
    font-size: 1.3rem;
}

.overall-progress .progress-bar-container {
    max-width: 600px;
    margin: 0 auto 10px;
    height: 32px;
}

.overall-progress .progress-bar {
    font-size: 1rem;
    font-weight: bold;
}

.overall-progress p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ==================== BUTTONS ==================== */

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--text-secondary);
    color: white;
}

.btn-secondary:hover {
    background: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: var(--success);
    color: white;
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-success:hover {
    background: #45a049;
    transform: scale(1.05);
}

.btn-danger {
    background: var(--danger);
    color: white;
    padding: 6px 12px;
    font-size: 0.85rem;
}

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

.btn-icon {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 6px;
    transition: transform 0.2s;
}

.btn-icon:hover {
    transform: scale(1.2);
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s;
}

.btn-link:hover {
    opacity: 0.7;
    text-decoration: underline;
}

.progress-bar-container:hover {
    opacity: 0.9;
}

/* ==================== CONTROLS ==================== */

.controls {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.sort-controls label {
    font-weight: 600;
    color: var(--text-secondary);
}

.sort-btn {
    padding: 8px 16px;
    border: 2px solid var(--border);
    background: white;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.sort-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.sort-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.search-controls {
    margin-top: 10px;
}

.search-controls input {
    width: 100%;
    max-width: 360px;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
}

.search-controls input:focus {
    outline: none;
    border-color: var(--primary);
}

/* ==================== SONGS LIST ==================== */

.songs-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.song-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border-left: 6px solid var(--border);
}

.song-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(5px);
}

.song-card.priority-high {
    border-left-color: var(--danger);
}

.song-card.priority-mid {
    border-left-color: var(--warning);
}

.song-card.priority-low {
    border-left-color: var(--success);
}

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

.song-info {
    flex: 1;
}

.song-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.song-number {
    background: var(--primary);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

.song-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.performance-hints {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

.performance-hints strong {
    font-weight: 700;
    color: var(--text-primary);
}

.priority-badge {
    font-size: 1.5rem;
    margin-left: 10px;
    cursor: pointer;
    transition: transform 0.2s;
    user-select: none;
}

.difficulty-badge {
    font-size: 1.5rem;
    margin-left: 8px;
    cursor: pointer;
    transition: transform 0.2s;
    user-select: none;
}

.priority-badge:hover {
    transform: scale(1.2);
}

.difficulty-badge:hover {
    transform: scale(1.2);
}

.priority-badge:active {
    transform: scale(0.95);
}

.difficulty-badge:active {
    transform: scale(0.95);
}

.drag-handle {
    margin-left: 8px;
    cursor: grab;
    color: var(--text-muted);
    user-select: none;
    font-size: 1.2rem;
}

.drag-handle:active {
    cursor: grabbing;
}

.song-card.dragging {
    opacity: 0.7;
    transform: rotate(0.5deg);
    cursor: grabbing !important;
}

.song-artist {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-left: 42px;
}

.song-actions {
    display: flex;
    gap: 8px;
}

.song-actions .attach-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
}

/* Last Practiced Badge */
.last-practiced {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-left: 42px;
    margin-top: 5px;
}

.last-practiced.never {
    color: var(--danger);
    font-weight: 600;
}

/* ==================== SKILLS ==================== */

.skills-section {
    margin-bottom: 15px;
}

.skills-section h4 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    margin-left: 42px;
}

.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-left: 42px;
}

.skill-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.skill-item:hover {
    background: var(--bg-primary);
    border-color: var(--primary);
}

.skill-item.mastered {
    background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
    border-color: #fdcb6e;
}

.skill-star {
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.skill-item.mastered .skill-star {
    filter: drop-shadow(0 0 4px rgba(253, 203, 110, 0.8));
}

.skill-name {
    font-size: 0.9rem;
    font-weight: 500;
}

/* ==================== PRACTICE SECTION ==================== */

.practice-section {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-left: 42px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.practice-button {
    display: flex;
    align-items: center;
    gap: 8px;
}

.practice-progress {
    flex: 1;
    min-width: 200px;
}

.progress-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
}

.progress-bar-container {
    width: 100%;
    height: 24px;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.8rem;
}

.progress-bar.complete {
    background: linear-gradient(90deg, var(--success), #45a049);
}

/* Notes section */
.song-notes {
    margin-top: 15px;
    padding: 12px;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    margin-left: 42px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
}

.song-audio {
    margin-left: 42px;
    margin-top: 10px;
}

.audio-link {
    text-decoration: none;
    font-weight: 600;
    color: var(--info);
}

.audio-link:hover {
    text-decoration: underline;
}

/* ==================== MODAL ==================== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--bg-card);
    margin: 5% auto;
    padding: 30px;
    border-radius: var(--radius);
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideDown 0.3s ease;
}

.modal-content.draggable-modal {
    position: absolute;
    margin: 0;
    top: 80px;
    left: 80px;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-drag-handle {
    cursor: move;
    font-size: 0.7rem;
    color: var(--text-muted);
    background: var(--bg-hover);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    display: inline-block;
    margin-bottom: 8px;
    user-select: none;
}

.modal-content.draggable-modal .modal-drag-handle {
    background: linear-gradient(135deg, var(--bg-hover), var(--bg-primary));
}

.modal-content.modal-moving {
    opacity: 0.95;
    box-shadow: var(--shadow-lg);
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    color: var(--text-muted);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: var(--text-primary);
}

.modal-content h2 {
    margin-bottom: 20px;
    color: var(--primary);
}

.modal-overlay {
    display: flex;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
    align-items: center;
    justify-content: center;
}

/* ==================== FORMS ==================== */

.form-group {
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group small {
    display: block;
    margin-top: 4px;
    font-size: 0.85rem;
    line-height: 1.3;
}

.skills-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
}

.skills-checkboxes label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 400;
}

.skills-checkboxes input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
}

/* ==================== ADMIN PAGE ==================== */

.admin-content {
    max-width: 800px;
}

.admin-section {
    background: var(--bg-card);
    padding: 25px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.admin-section h2 {
    margin-bottom: 20px;
    color: var(--primary);
    font-size: 1.5rem;
}

.inline-form {
    display: flex;
    gap: 10px;
}

.inline-form input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
}

.inline-form input:focus {
    outline: none;
    border-color: var(--primary);
}

.skills-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skills-list .skill-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.skills-list .skill-item:hover {
    background: var(--bg-primary);
    box-shadow: var(--shadow-sm);
}

.skill-info {
    flex: 1;
}

.skill-name {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
}

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

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
    font-style: italic;
}

/* ==================== RESPONSIVE ==================== */

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

    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    header h1 {
        font-size: 2rem;
    }

    .song-header {
        flex-direction: column;
        gap: 10px;
    }

    .practice-section {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal-content.draggable-modal {
        left: 10px !important;
        top: 10px !important;
        width: calc(100% - 20px);
        max-width: none;
    }
}
