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

/* Login Screen */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
    min-width: 350px;
}

.login-box h1 {
    color: #333;
    margin-bottom: 10px;
}

.login-box p {
    color: #666;
    margin-bottom: 30px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.login-form input {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

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

.login-form button {
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.login-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.error-message {
    color: #dc3545;
    font-size: 14px;
    margin-top: 10px;
    min-height: 20px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1900px;
    margin: 0 auto;
    padding: 30px;
}

header {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    text-align: center;
    position: relative;
}

.logout-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
}

header h1 {
    color: #667eea;
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    color: #666;
    font-size: 1.1em;
}

#guildId {
    font-family: monospace;
    background: #f0f0f0;
    padding: 4px 8px;
    border-radius: 4px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    background: white;
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.tab-button {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 1.1em;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s;
}

.tab-button:hover {
    background: #f5f5f5;
}

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

.tab-content {
    display: none;
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

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

/* Upload Section */
.upload-area {
    border: 3px dashed #ddd;
    border-radius: 12px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin: 20px 0;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.upload-area.dragover {
    border-color: #667eea;
    background: #f0f3ff;
}

.upload-prompt svg {
    color: #667eea;
    margin-bottom: 20px;
}

.upload-prompt p {
    font-size: 1.2em;
    color: #333;
    margin-bottom: 10px;
}

.upload-prompt small {
    color: #666;
}

.upload-progress {
    margin: 20px 0;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #f0f0f0;
    border-radius: 15px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 15px;
    transition: width 0.3s;
    width: 0%;
}

.uploaded-list {
    margin-top: 20px;
}

.uploaded-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
}

.uploaded-item.success {
    background: #d4edda;
    color: #155724;
}

/* Video Editor */
.video-editor video {
    width: 100%;
    max-width: 800px;
    margin: 20px auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.video-input {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.video-source-selector {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
}

.source-option {
    flex: 1;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.source-option h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 1.1em;
}

.youtube-input {
    display: flex;
    gap: 10px;
    align-items: center;
}

.youtube-url-input {
    flex: 1;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
}

#youtubeLoadingStatus {
    margin-top: 10px;
    font-size: 0.9em;
    color: #667eea;
}

#videoFileName {
    color: #666;
    font-style: italic;
}

.trim-controls {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.time-inputs {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.input-group {
    flex: 1;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #666;
    font-weight: 500;
}

.input-group input {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s;
}

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

.range-slider {
    position: relative;
    height: 60px;
    margin: 30px 0;
}

.range-slider input[type="range"] {
    position: absolute;
    width: 100%;
    height: 20px;
    background: transparent;
    pointer-events: auto;
    -webkit-appearance: none;
    cursor: pointer;
}

.range-slider input[type="range"]#startSlider {
    z-index: 5;
    top: 0;  /* Top position for start slider */
}

.range-slider input[type="range"]#endSlider {
    z-index: 4;
    bottom: 0;  /* Bottom position for end slider */
}

.range-slider input[type="range"]::-webkit-slider-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    -webkit-appearance: none;
    pointer-events: all;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.slider-track {
    position: absolute;
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    top: 17px;
    pointer-events: none;
    z-index: 1;
}

.slider-selection {
    position: absolute;
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 3px;
}

.preview-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}

#duration {
    color: #666;
    font-weight: 500;
}

/* Manage Section */
.search-bar {
    margin-bottom: 20px;
}

.search-bar input {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1.1em;
}

.soundboard-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
    gap: 25px;
    max-height: 70vh;
    overflow-y: auto;
    padding: 15px;
}

.soundboard-list::-webkit-scrollbar {
    width: 8px;
}

.soundboard-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.soundboard-list::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.soundboard-list::-webkit-scrollbar-thumb:hover {
    background: #5a67d8;
}

.soundboard-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
    transition: all 0.3s;
    border: 2px solid transparent;
    min-height: 220px;
    box-sizing: border-box;
}

.soundboard-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.soundboard-name {
    font-weight: 600;
    font-size: 1.1em;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.soundboard-emoji {
    font-size: 1.2em;
}

.soundboard-info {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 12px;
}

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

/* Volume Control */
.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
    padding: 10px 12px;
    background: #f0f0f0;
    border-radius: 6px;
    width: calc(100% - 4px);
    box-sizing: border-box;
}

.volume-control label {
    font-weight: 500;
    color: #333;
    min-width: 90px;
    white-space: nowrap;
}

.volume-value {
    font-weight: bold;
    color: #667eea;
}

.volume-slider {
    flex: 1;
    max-width: 280px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #ddd;
    border-radius: 3px;
    outline: none;
    margin: 0 8px;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s;
}

.volume-slider::-webkit-slider-thumb:hover {
    background: #5a67d8;
}

.volume-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s;
}

.volume-slider::-moz-range-thumb:hover {
    background: #5a67d8;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

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

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

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

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

.btn-small {
    padding: 6px 12px;
    font-size: 0.9em;
}

.volume-control .btn-secondary {
    flex-shrink: 0;
    margin-left: 8px;
}

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

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #333;
}

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

.loading {
    text-align: center;
    color: #666;
    padding: 40px;
    font-size: 1.1em;
}

/* Responsive */
@media (max-width: 768px) {
    .tabs {
        flex-direction: column;
    }
    
    .time-inputs {
        flex-direction: column;
    }
    
    .soundboard-list {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 1700px) {
    .container {
        max-width: 2000px;
    }
    .soundboard-list {
        grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
    }
}

@media (min-width: 2100px) {
    .container {
        max-width: 2200px;
    }
    .soundboard-list {
        grid-template-columns: repeat(auto-fill, minmax(520px, 1fr));
    }
}

/* Extraction Progress */
.extraction-progress {
    margin-top: 20px;
}

.progress-bar-container {
    width: 100%;
    height: 24px;
    background: #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #0056b3);
    border-radius: 12px;
    width: 0%;
    transition: width 0.3s ease, background 0.3s ease;
    position: relative;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0.3) 50%,
        rgba(255,255,255,0) 100%
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Spinner animation */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #28a745;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.progress-text {
    text-align: center;
    margin-top: 10px;
    color: #666;
    font-size: 14px;
    font-weight: 500;
}