:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --danger-color: #dc2626;
    --danger-hover: #b91c1c;
    --background: #f9fafb;
    --surface: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border: #e5e7eb;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--background);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

header h1 {
    font-size: 2rem;
    color: var(--text-primary);
}

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

/* Buttons */
.btn {
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-primary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn:hover {
    background: var(--background);
}

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

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

.btn-danger {
    background: var(--danger-color);
    color: white;
    border: none;
}

.btn-danger:hover {
    background: var(--danger-hover);
}

/* Search Bar */
.search-bar {
    margin-bottom: 20px;
}

.search-bar input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 16px;
}

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

/* Song List */
.song-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.song-card {
    background: var(--surface);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.2s;
}

.song-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.song-card h3 {
    margin-bottom: 5px;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.song-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

/* Song Display */
.song-controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 10px;
}

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

.song-content {
    background: var(--surface);
    padding: 40px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.song-header {
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 20px;
}

.song-header h2 {
    font-size: 2rem;
    margin-bottom: 5px;
}

.song-header .artist {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.song-lyrics {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 2.5;
    white-space: pre-wrap;
}

.lyrics-line {
    margin-bottom: 10px;
    position: relative;
    padding-top: 30px;
}

.chord {
    color: transparent;
    font-weight: bold;
    position: relative;
    display: inline-block;
    white-space: nowrap;
}

.chord::before {
    content: attr(data-chord);
    position: absolute;
    top: -1.5em;
    left: 0;
    font-size: 13px;
    color: var(--primary-color);
    font-weight: bold;
    white-space: nowrap;
}

/* Song Form */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 16px;
    font-family: inherit;
}

.form-group textarea {
    font-family: 'Courier New', monospace;
    resize: vertical;
}

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

.help-text {
    display: block;
    margin-top: 5px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--surface);
    padding: 30px;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h2 {
    margin-bottom: 15px;
}

.modal-content h3 {
    font-size: 1rem;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.import-options {
    margin: 20px 0;
}

.import-option {
    margin-bottom: 20px;
}

.import-option input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

.import-divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.import-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border);
}

.import-divider span {
    position: relative;
    background: var(--surface);
    padding: 0 15px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.modal-content textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    margin: 0;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Print Styles */
@media print {
    body {
        background: white;
    }

    .container {
        max-width: none;
        padding: 0;
    }

    header,
    .song-controls,
    .search-bar,
    .btn {
        display: none !important;
    }

    .song-content {
        box-shadow: none;
        padding: 20px;
    }

    .song-lyrics {
        font-size: 12pt;
        line-height: 2.2;
    }

    .chord::before {
        color: #000;
    }
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.5rem;
    }

    .song-content {
        padding: 20px;
    }

    .song-header h2 {
        font-size: 1.5rem;
    }

    .song-list {
        grid-template-columns: 1fr;
    }
}
