:root {
    --bg-color: #0d1117;
    --card-bg: rgba(22, 27, 34, 0.8);
    --teal: #64ffda;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --error: #ff7b72;
    --success: #3fb950;
    --gradient: linear-gradient(135deg, #1f2937 0%, #0d1117 100%);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(100, 255, 218, 0.05) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(100, 255, 218, 0.05) 0%, transparent 20%);
}

.glass-container {
    width: 90%;
    max-width: 900px;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo h1 {
    font-size: 1.8rem;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #fff, var(--teal));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.badge.online {
    background: rgba(63, 185, 80, 0.15);
    color: var(--success);
    border: 1px solid var(--success);
}

.badge.offline {
    background: rgba(255, 123, 114, 0.15);
    color: var(--error);
    border: 1px solid var(--error);
}

section {
    margin-bottom: 30px;
    padding: 24px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
}

h2 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.input-group {
    display: flex;
    gap: 12px;
}

input {
    flex: 1;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 10px;
    padding: 12px 16px;
    color: white;
    font-family: inherit;
    transition: border 0.3s;
}

input:focus {
    outline: none;
    border-color: var(--teal);
}

button {
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.primary-btn {
    background: var(--teal);
    color: #0d1117;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(100, 255, 218, 0.4);
}

.analysis-section.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.tabs {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    border-bottom: 1px solid #30363d;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 10px 0;
    position: relative;
    font-size: 1rem;
}

.tab-btn.active {
    color: var(--teal);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--teal);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

.upload-area {
    border: 2px dashed #30363d;
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s;
}

.upload-area:hover {
    border-color: var(--teal);
    background: rgba(100, 255, 218, 0.05);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.upload-area span {
    color: var(--teal);
    text-decoration: underline;
    cursor: pointer;
}

/* Camera Styles */
.camera-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid #30363d;
}

#camera-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recording-dot {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 15px;
    height: 15px;
    background: #ff4444;
    border-radius: 50%;
    box-shadow: 0 0 10px #ff4444;
    animation: blink 1s infinite;
}

@keyframes blink {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }

    100% {
        opacity: 1;
    }
}

.controls {
    display: flex;
    gap: 12px;
}

.file-name {
    margin-top: 10px;
    color: var(--teal);
    font-weight: 500;
}

.action-btn {
    width: 100%;
    margin-top: 20px;
    padding: 16px;
    border-radius: 12px;
    border: none;
    background: #1f2937;
    color: white;
    font-size: 1.1rem;
}

.action-btn:not(:disabled) {
    background: linear-gradient(to right, #64ffda, #00bfa5);
    color: #0d1117;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.hidden {
    display: none !important;
}

/* Task Selector */
.task-selector {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.task-dropdown {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    padding: 0.8rem;
    border-radius: 8px;
    width: 100%;
    max-width: 300px;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
}

.task-dropdown option {
    background: #0d1117;
    color: white;
}

.instruction-box {
    background: rgba(100, 255, 218, 0.1);
    border: 1px solid var(--accent-cyan);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
    max-width: 400px;
    text-align: center;
    transition: border-color 0.3s ease;
}

/* Results */
.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 20px;
}

.result-card {
    background: #0d1117;
    padding: 20px;
    border-radius: 16px;
    text-align: center;
    border: 1px solid #30363d;
}

.gauge-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 20px auto;
}

.gauge {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(var(--teal) calc(var(--percent) * 1%), #161b22 0);
    position: relative;
}

.gauge::before {
    content: '';
    position: absolute;
    inset: 12px;
    background: #0d1117;
    border-radius: 50%;
}

.score {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--teal);
}

.features-list {
    margin-top: 30px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.feature-item {
    background: #161b22;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
}

.val {
    color: var(--teal);
    font-weight: 600;
}

.disclaimer {
    margin-top: 30px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
    font-style: italic;
}

/* Loader */
.loader-overlay {
    position: absolute;
    inset: 0;
    background: rgba(13, 17, 23, 0.9);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(100, 255, 218, 0.1);
    border-top-color: var(--teal);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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