:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.1);
    --accent: #10b981;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow-x: hidden;
}

/* Background Blobs */
.background-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.blob {
    position: absolute;
    filter: blur(100px);
    border-radius: 50%;
    opacity: 0.5;
    animation: float 10s infinite ease-in-out alternate;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(59,130,246,0.4) 0%, rgba(15,23,42,0) 70%);
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, rgba(16,185,129,0.3) 0%, rgba(15,23,42,0) 70%);
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, -50px) scale(1.1); }
}

/* LOGIN OVERLAY */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(8px);
}

.login-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    text-align: center;
    max-width: 400px;
    width: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-card h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.login-card p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

/* HEADER USER PROFILE */
.header-top {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.05);
    padding: 5px 15px 5px 5px;
    border-radius: 50px;
    border: 1px solid var(--border-color);
}

.avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

#user-name {
    font-size: 0.9rem;
    font-weight: 500;
}

.btn-text-only {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    margin-left: 10px;
    text-decoration: underline;
}

.btn-text-only:hover {
    color: white;
}

/* MAIN CONTAINER */
.container {
    width: 100%;
    max-width: 1000px;
    padding: 2rem;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

h1 {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

h1 span {
    color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Glassmorphism Card */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    flex: 1;
}

label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

select {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.8rem 1rem;
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
    appearance: none;
}

select:focus {
    border-color: var(--primary-color);
}

button {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    min-width: 180px;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:disabled {
    background-color: #475569;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

.hidden {
    display: none !important;
}

/* Progress Section */
.progress-section {
    margin-top: 2rem;
    animation: fadeIn 0.5s ease;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
}

.status-text {
    color: var(--text-muted);
}

.progress-percentage {
    font-weight: 600;
    color: var(--primary-color);
}

.progress-bar-bg {
    height: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent));
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Results Section */
.results-section {
    margin-top: 2.5rem;
    animation: fadeIn 0.5s ease;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

h2 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 600;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th, td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: rgba(15, 23, 42, 0.4);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr:last-child td {
    border-bottom: none;
}

tbody tr {
    transition: background-color 0.2s;
}

tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

td {
    font-size: 0.95rem;
}

.highlight {
    font-weight: 600;
    color: var(--text-main);
}

.positive {
    color: var(--accent);
}

/* Error */
.error-section {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    color: #ef4444;
}

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

@media (max-width: 768px) {
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    h1 {
        font-size: 2.5rem;
    }
}

/* Email Login Form */
.email-login-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.email-login-form input {
    width: 100%;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.6);
    color: var(--text-main);
    outline: none;
    font-family: var(--font-body);
}

.email-login-form input:focus {
    border-color: var(--primary-color);
}

.divider {
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    position: relative;
    width: 100%;
}

.divider::before, .divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--border-color);
}

.divider::before { left: 0; }
.divider::after { right: 0; }

/* Inactive Overlay */
.inactive-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50;
    border-radius: 20px;
}

.inactive-message {
    text-align: center;
    padding: 2rem;
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid var(--primary-color);
    border-radius: 15px;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.inactive-message h2 {
    color: var(--text-main);
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.inactive-message p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.inactive-message .btn-primary {
    display: inline-block;
    text-decoration: none;
}
