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

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

.hidden {
    display: none !important;
}

/* Splash Screen */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.splash-content {
    text-align: center;
    color: white;
}

.splash-logo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.splash-content h1 {
    font-size: 3rem;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.loading-bar {
    width: 200px;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.loading-progress {
    height: 100%;
    background: white;
    border-radius: 2px;
    animation: loading 4s ease-in-out;
}

@keyframes loading {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* Main App */
.main-app {
    min-height: 100vh;
    background: #f5f7fa;
}

/* Header */
.header {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 15px;
}

.header h1 {
    flex: 1;
    color: #2c3e50;
    font-size: 1.8rem;
}

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

.btn-icon {
    background: none;
    border: none;
    font-size: 1.2rem;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-icon:hover {
    background: #f0f0f0;
}

/* Navigation */
.nav-tabs {
    background: white;
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-tab {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: #666;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.nav-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: #f8f9ff;
}

/* Tab Content */
.tab-content {
    display: none;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.tab-content.active {
    display: block;
}

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.tab-header h2 {
    color: #2c3e50;
    font-size: 1.8rem;
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

/* Grids */
.setlists-grid, .songs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.setlist-card, .song-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.setlist-card:hover, .song-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.setlist-logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-bottom: 1rem;
}

.setlist-name, .song-title {
    font-size: 1.3rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.song-artist {
    color: #666;
    margin-bottom: 0.5rem;
}

.song-key {
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    display: inline-block;
}

/* Search */
.search-bar, .search-form {
    margin-bottom: 2rem;
}

.search-bar input, .search-form input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.search-bar input:focus, .search-form input:focus {
    outline: none;
    border-color: #667eea;
}

.search-form {
    display: flex;
    gap: 1rem;
}

.search-form input {
    flex: 1;
}

.search-results {
    display: grid;
    gap: 1rem;
}

.search-result {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Modals */
.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.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.fullscreen-modal .modal-content {
    max-width: 95%;
    width: 95%;
    height: 90vh;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
    padding: 0 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

/* Text Editor */
.text-editor {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.editor-toolbar {
    background: #f8f9fa;
    padding: 8px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    gap: 5px;
}

.editor-btn {
    padding: 6px 10px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.editor-btn:hover {
    background: #e9ecef;
}

.lyrics-editor {
    min-height: 200px;
    padding: 12px;
    outline: none;
    font-family: monospace;
    line-height: 1.6;
}

/* Setlist Songs */
.setlist-songs {
    padding: 1rem;
}

.setlist-song-item {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    cursor: move;
    transition: all 0.3s;
}

.setlist-song-item:hover {
    background: #e9ecef;
}

.setlist-song-item.dragging {
    opacity: 0.5;
}

.song-order {
    background: #667eea;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-weight: bold;
}

.song-info {
    flex: 1;
}

.song-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

.btn-play {
    background: #27ae60;
    color: white;
}

.btn-edit {
    background: #f39c12;
    color: white;
}

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

/* Teleprompter */
.teleprompter-content {
    width: 100%;
    height: 100vh;
    background: #000;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.teleprompter-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 10;
    opacity: 1;
    transition: opacity 0.3s;
}

.teleprompter-controls.hidden {
    opacity: 0;
    pointer-events: none;
}

.control-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
}

.control-btn:hover {
    background: rgba(255,255,255,0.3);
}

.speed-slider {
    width: 100px;
}

.teleprompter-text {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 800px;
    font-size: 2rem;
    line-height: 1.8;
    text-align: center;
    white-space: pre-line;
    padding: 2rem;
    transition: top 0.1s linear;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        padding: 1rem;
    }
    
    .tab-content {
        padding: 1rem;
    }
    
    .setlists-grid, .songs-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .setlist-song-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .song-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .teleprompter-text {
        font-size: 1.5rem;
        width: 95%;
    }
    
    .teleprompter-controls {
        top: 10px;
        right: 10px;
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .splash-content h1 {
        font-size: 2rem;
    }
    
    .header h1 {
        font-size: 1.4rem;
    }
    
    .tab-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .teleprompter-text {
        font-size: 1.2rem;
    }
}

/* Sortable */
.sortable-ghost {
    opacity: 0.4;
}

.sortable-chosen {
    background: #667eea !important;
    color: white;
}

/* Offline indicator */
.offline-indicator {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #e74c3c;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    z-index: 1000;
    display: none;
}

.offline-indicator.show {
    display: block;
}