/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #0f172a;
    color: #f1f5f9;
    line-height: 1.6;
    min-height: 100vh;
}

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

/* Navigation */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #334155;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 28px;
    color: #8b5cf6;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    color: #f1f5f9;
}

.logo-subtext {
    font-size: 14px;
    color: #94a3b8;
    font-weight: 400;
}

.nav-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #94a3b8;
    background: rgba(30, 41, 59, 0.5);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #334155;
}

#statusIcon {
    font-size: 10px;
    color: #94a3b8;
}

#statusIcon.online {
    color: #22c55e;
}

#statusIcon.offline {
    color: #ef4444;
}

#statusIcon.waking {
    color: #f59e0b;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
}

.hero-title {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 10px;
    line-height: 1.2;
}

.gradient-text {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    display: block;
    font-size: 18px;
    color: #cbd5e1;
    margin-top: 8px;
}

.hero-description {
    font-size: 16px;
    color: #94a3b8;
    max-width: 600px;
    margin: 20px auto 0;
}

/* Status Message */
.status {
    padding: 15px 20px;
    border-radius: 10px;
    margin: 20px auto;
    max-width: 800px;
    display: none;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.status.show {
    display: flex;
    animation: slideIn 0.3s ease;
}

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

.status.success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.status.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.status.processing {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #3b82f6;
}

.status.warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #f59e0b;
}

/* Upload Section */
.upload-section {
    background: #1e293b;
    border-radius: 16px;
    padding: 30px;
    margin: 30px auto;
    border: 1px solid #334155;
    max-width: 800px;
}

.upload-header {
    text-align: center;
    margin-bottom: 30px;
}

.upload-icon {
    font-size: 48px;
    color: #8b5cf6;
    margin-bottom: 15px;
}

.upload-header h2 {
    font-size: 24px;
    margin-bottom: 8px;
    color: #f1f5f9;
}

.upload-header p {
    color: #94a3b8;
}

/* Drop Zone */
.drop-zone {
    border: 3px dashed #475569;
    border-radius: 12px;
    padding: 50px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 25px;
    background: rgba(124, 58, 237, 0.03);
}

.drop-zone:hover {
    border-color: #8b5cf6;
    background: rgba(124, 58, 237, 0.08);
}

.drop-zone.dragover {
    border-color: #8b5cf6;
    background: rgba(124, 58, 237, 0.12);
    animation: pulseBorder 2s infinite;
}

@keyframes pulseBorder {
    0%, 100% { border-color: #8b5cf6; }
    50% { border-color: #a78bfa; }
}

.drop-content i {
    font-size: 48px;
    color: #8b5cf6;
    margin-bottom: 15px;
}

.drop-content p {
    font-size: 18px;
    margin-bottom: 8px;
    color: #e2e8f0;
}

.file-format {
    font-size: 14px;
    color: #8b5cf6;
    font-weight: 600;
}

/* File Preview */
.file-preview {
    background: rgba(124, 58, 237, 0.08);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid rgba(124, 58, 237, 0.2);
    animation: fadeIn 0.3s ease;
}

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

.file-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-info i {
    font-size: 24px;
    color: #8b5cf6;
}

.file-details h4 {
    color: #f1f5f9;
    margin-bottom: 4px;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

.file-details p {
    color: #94a3b8;
    font-size: 14px;
}

.remove-btn {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
}

.remove-btn:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Options */
.options {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: #cbd5e1;
    font-size: 15px;
    user-select: none;
}

.option input {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #475569;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.option:hover .checkmark {
    border-color: #8b5cf6;
}

.option input:checked + .checkmark {
    background: #8b5cf6;
    border-color: #8b5cf6;
}

.option input:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-size: 12px;
}

/* Process Button */
.process-btn {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    border: none;
    padding: 16px 32px;
    font-size: 16px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    font-weight: 600;
    transition: all 0.3s;
    margin-top: 10px;
}

.process-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(124, 58, 237, 0.3);
}

.process-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Backend Info */
.backend-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding: 12px;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 8px;
    font-size: 14px;
    color: #94a3b8;
    border: 1px solid #334155;
}

.backend-info i {
    color: #8b5cf6;
}

.backend-info a {
    color: #60a5fa;
    text-decoration: none;
}

.backend-info a:hover {
    text-decoration: underline;
}

.status-indicator {
    margin-left: auto;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.status-indicator.online {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-indicator.offline {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-indicator.waking {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
    animation: pulse 1.5s infinite;
}

/* Results Section */
.results-section {
    background: #1e293b;
    border-radius: 16px;
    padding: 30px;
    margin: 30px auto;
    border: 1px solid #334155;
    max-width: 800px;
    animation: fadeIn 0.5s ease;
}

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

.results-header h3 {
    font-size: 20px;
    color: #f1f5f9;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.action-btn {
    background: #334155;
    border: 1px solid #475569;
    color: #cbd5e1;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: all 0.2s;
    white-space: nowrap;
}

.action-btn:hover {
    background: #475569;
    color: #f1f5f9;
}

.download-btn {
    background: #8b5cf6;
    border-color: #8b5cf6;
    color: white;
}

.download-btn:hover {
    background: #7c3aed;
}

.clear-btn {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.clear-btn:hover {
    background: rgba(239, 68, 68, 0.2);
}

.results-info {
    display: flex;
    gap: 25px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #94a3b8;
    font-size: 14px;
}

.info-item i {
    color: #8b5cf6;
}

.info-item strong {
    color: #f1f5f9;
}

/* Code Container */
.code-container {
    background: #0f172a;
    border-radius: 10px;
    padding: 20px;
    overflow-x: auto;
    border: 1px solid #334155;
    max-height: 500px;
}

#resultCode {
    font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #e2e8f0;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
}

/* Info Section */
.info-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #334155;
}

.info-section h3 {
    font-size: 20px;
    color: #f1f5f9;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.info-card {
    background: #1e293b;
    border-radius: 12px;
    padding: 25px;
    border: 1px solid #334155;
    transition: transform 0.3s;
}

.info-card:hover {
    transform: translateY(-5px);
}

.info-icon {
    font-size: 32px;
    color: #8b5cf6;
    margin-bottom: 15px;
}

.info-card h4 {
    font-size: 18px;
    color: #f1f5f9;
    margin-bottom: 10px;
}

.info-card p {
    color: #94a3b8;
    font-size: 14px;
    line-height: 1.5;
}

/* Footer */
.footer {
    text-align: center;
    padding: 40px 0;
    color: #64748b;
    font-size: 14px;
    margin-top: 60px;
    border-top: 1px solid #334155;
}

.footer a {
    color: #8b5cf6;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

.footer .note {
    margin-top: 10px;
    font-size: 13px;
    color: #475569;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #1e293b;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .navbar {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .nav-status {
        width: 100%;
        justify-content: center;
    }
    
    .hero-title {
        font-size: 32px;
    }
    
    .upload-section,
    .results-section {
        padding: 20px;
    }
    
    .drop-zone {
        padding: 30px 15px;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .results-actions {
        width: 100%;
    }
    
    .action-btn {
        flex: 1;
        justify-content: center;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .file-details h4 {
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 28px;
    }
    
    .options {
        flex-direction: column;
        gap: 15px;
    }
    
    .results-info {
        flex-direction: column;
        gap: 15px;
    }
    
    .backend-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .status-indicator {
        margin-left: 0;
    }
}