/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #0f0f0f;
    color: #e5e5e5;
    line-height: 1.6;
    min-height: 100vh;
}

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

/* Header */
header {
    margin-bottom: 3rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-link {
    background: rgba(55, 65, 81, 0.5);
    border: 1px solid #4b5563;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    color: #e5e5e5;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.admin-link:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
    color: #3b82f6;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.combo-badge {
    background: linear-gradient(135deg, #1f2937, #374151);
    border: 1px solid #4b5563;
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #f3f4f6;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Upload Grid */
.upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.upload-card {
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    border: 1px solid #404040;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.upload-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
}

.upload-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 1rem;
    text-align: center;
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed #4b5563;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drop-zone:hover {
    border-color: #6b7280;
    background: rgba(75, 85, 99, 0.1);
}

.drop-zone.drag-over {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    transform: scale(1.02);
}

.drop-content {
    pointer-events: none;
}

.upload-icon {
    width: 48px;
    height: 48px;
    color: #9ca3af;
    margin-bottom: 1rem;
}

.drop-zone p {
    color: #9ca3af;
    font-size: 1rem;
    margin: 0;
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* File List */
.file-list {
    margin-top: 1rem;
    max-height: 200px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: rgba(55, 65, 81, 0.5);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.file-name {
    color: #e5e5e5;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-remove {
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.2s ease;
}

.file-remove:hover {
    background: #b91c1c;
}

/* Action Section */
.action-section {
    text-align: center;
    margin-bottom: 3rem;
}

.project-name-section {
    margin-bottom: 2rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.project-label {
    display: block;
    color: #e5e5e5;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    text-align: left;
}

.project-input {
    width: 100%;
    background: rgba(55, 65, 81, 0.5);
    border: 1px solid #4b5563;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    color: #ffffff;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.project-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), 0 4px 12px rgba(0, 0, 0, 0.15);
    background: rgba(55, 65, 81, 0.7);
}

.project-input::placeholder {
    color: #9ca3af;
}

.project-input:invalid {
    border-color: #dc2626;
}

.project-input:invalid:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1), 0 4px 12px rgba(0, 0, 0, 0.15);
}

.build-button {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.build-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.build-button:disabled {
    background: #374151;
    color: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Progress Section */
.progress-section {
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    border: 1px solid #404040;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.progress-item {
    margin-bottom: 1.5rem;
}

.progress-item:last-child {
    margin-bottom: 0;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.progress-count {
    color: #9ca3af;
    font-size: 0.9rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #374151;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Result Section */
.result-section {
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    border: 1px solid #404040;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.result-header {
    text-align: center;
    margin-bottom: 2rem;
}

.result-header h3 {
    color: #ffffff;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.result-header p {
    color: #d1fae5;
    margin-bottom: 1.5rem;
}

.bulk-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.select-all-btn,
.download-selected-btn,
.download-all-btn {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.select-all-btn:hover,
.download-all-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.download-selected-btn:disabled {
    background: #374151;
    color: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.download-selected-btn:not(:disabled):hover {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.video-card {
    background: linear-gradient(135deg, #2d2d2d, #404040);
    border: 1px solid #525252;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.video-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.video-preview {
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
}

.video-player {
    width: 100%;
    height: auto;
    max-height: 200px;
    background: #000;
    border-radius: 8px;
}

.video-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.video-filename {
    color: #ffffff;
    font-weight: 500;
    font-size: 0.9rem;
    word-break: break-all;
}

.video-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.video-checkbox {
    margin: 0;
    transform: scale(1.2);
}

.checkbox-label {
    color: #e5e5e5;
    font-size: 0.9rem;
    cursor: pointer;
    user-select: none;
}

.download-individual-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.download-individual-btn:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* Error Section */
.error-section {
    text-align: center;
}

.error-card {
    background: linear-gradient(135deg, #7f1d1d, #991b1b);
    border: 1px solid #dc2626;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.error-card h3 {
    color: #ffffff;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.error-card p {
    color: #fecaca;
    margin-bottom: 1.5rem;
}

.retry-button {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
}

.retry-button:hover {
    background: linear-gradient(135deg, #b91c1c, #991b1b);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .upload-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .upload-card {
        padding: 1rem;
    }
    
    .drop-zone {
        padding: 1.5rem;
        min-height: 120px;
    }
    
    .upload-icon {
        width: 36px;
        height: 36px;
    }
    
    header {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .combo-badge {
        font-size: 1rem;
        padding: 0.5rem 1rem;
    }
    
    .build-button,
    .download-button,
    .retry-button {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
    border-top: 1px solid #404040;
    color: #9ca3af;
}

.app-footer p {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
}

.results-section {
    margin-top: 20px;
    padding: 20px;
    background: #2a2a2a;
    border-radius: 8px;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.video-item {
    background: #333;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
}

.video-item video {
    border-radius: 5px;
    margin-bottom: 5px;
}

.video-item p {
    font-size: 12px;
    margin: 5px 0;
    word-break: break-all;
}

.download-all {
    text-align: center;
    margin-top: 20px;
}

.download-zip-btn {
    background: #007bff;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    display: inline-block;
}

.upload-info-section {
    background: #1a1a1a;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
}

.completion-message {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.success-message h2 {
    margin: 0 0 10px 0;
    font-size: 24px;
}

.success-message p {
    margin: 0;
    opacity: 0.9;
}

.download-section {
    background: #2a2a2a;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}

.download-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #444;
    padding-bottom: 15px;
}

.download-header h3 {
    margin: 0;
    color: #fff;
}

.download-all-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background 0.3s;
}

.download-all-btn:hover {
    background: #0056b3;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.video-card {
    background: #333;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s;
}

.video-card:hover {
    transform: translateY(-2px);
}

.video-preview video {
    border-radius: 8px 8px 0 0;
}

.video-info {
    padding: 15px;
}

.video-name {
    font-size: 12px;
    color: #fff;
    margin: 0 0 5px 0;
    word-break: break-all;
}

.video-size {
    font-size: 11px;
    color: #888;
    margin: 0 0 10px 0;
}

.download-btn {
    background: #28a745;
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 12px;
    display: inline-block;
    transition: background 0.3s;
}

.download-btn:hover {
    background: #1e7e34;
}
