:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #ec4899;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #0f172a;
    --dark-800: #1e293b;
    --dark-700: #334155;
    --dark-600: #475569;
    --light: #f8fafc;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --border: rgba(148, 163, 184, 0.1);
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(148, 163, 184, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    animation: rotate 30s linear infinite;
    z-index: 0;
    pointer-events: none;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    text-align: center;
    padding: 3rem 0;
    margin-bottom: 3rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 30px rgba(99, 102, 241, 0.3);
}

.header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Card */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.3);
}

.card h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card h2::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    border-radius: 2px;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text);
    font-weight: 500;
    font-size: 0.9rem;
}

input[type="text"],
input[type="number"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(15, 23, 42, 0.7);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

/* Buttons */
.btn {
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    font-family: inherit;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn span {
    position: relative;
    z-index: 1;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary), #db2777);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(236, 72, 153, 0.4);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* File Upload */
.file-upload {
    position: relative;
    display: block;
}

.file-upload input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    background: rgba(99, 102, 241, 0.1);
    border: 2px dashed var(--primary);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0;
}

.file-upload-label:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary-light);
}

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.stat-card {
    background: rgba(99, 102, 241, 0.1);
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    background: rgba(99, 102, 241, 0.15);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-light);
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 10px;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 300px;
    margin: 1.5rem 0;
    background: rgba(15, 23, 42, 0.3);
    border-radius: 12px;
    padding: 1rem;
}

/* Results */
.result-card {
    background: rgba(99, 102, 241, 0.05);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    margin-top: 1rem;
}

.emotion-tag {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1.1rem;
    margin: 0.5rem 0;
}

.confidence-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0.5rem 0;
}

.confidence-label {
    min-width: 100px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.confidence-fill {
    flex: 1;
    height: 24px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.confidence-value {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    transition: width 0.5s ease;
}

/* Alert */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

.alert-info {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--primary-light);
}

/* Loading Spinner */
.spinner {
    border: 3px solid rgba(99, 102, 241, 0.1);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Hidden */
.hidden {
    display: none !important;
}

/* Grid Layout */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Confusion Matrix */
.confusion-matrix {
    overflow-x: auto;
    margin: 1rem 0;
}

.confusion-matrix table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.confusion-matrix th,
.confusion-matrix td {
    padding: 0.75rem;
    text-align: center;
    border: 1px solid var(--border);
}

.confusion-matrix th {
    background: rgba(99, 102, 241, 0.2);
    font-weight: 600;
}

.confusion-matrix td {
    background: rgba(99, 102, 241, 0.05);
}

/* Responsive */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.75rem;
    }
    
    .container {
        padding: 1rem;
    }
    
    .card {
        padding: 1.25rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--dark);
}

::-webkit-scrollbar-thumb {
    background: var(--dark-600);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}
