/* 
 * style.css
 * Pergala Sêwirana Anketê û Rûpela Statîstîkan a Akademîk
 */

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #e0e7ff;
    --secondary: #0f172a;
    --background: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text-main: #334155;
    --text-muted: #64748b;
    --error: #ef4444;
    --success: #22c55e;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --background: #090d16;
        --surface: #131c2e;
        --border: #24324f;
        --secondary: #f1f5f9;
        --text-main: #cbd5e1;
        --text-muted: #94a3b8;
        --primary-light: #1e1b4b;
        --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
        --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
        --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    }
}

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

body {
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.6;
    padding: 2rem 1rem;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 680px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    transition: var(--transition);
    margin: 2rem auto;
}

.container-wide {
    max-width: 1100px;
    padding: 2.5rem;
    margin: 2rem auto;
}

/* Sernav û Sêwirana Akademîk */
.header {
    text-align: center;
    margin-bottom: 2.5rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 1.5rem;
}

.header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    background-color: var(--primary-light);
    color: var(--primary);
    margin-bottom: 1rem;
}

/* Form Elements */
.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

.input-text {
    width: 100%;
    padding: 0.875rem 1.25rem;
    border: 1px solid var(--border);
    background-color: var(--background);
    color: var(--text-main);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: var(--transition);
    outline: none;
}

.input-text:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Radio & Checkbox Styles */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.option-item {
    position: relative;
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.option-item:hover {
    border-color: var(--primary);
    background-color: var(--primary-light);
}

.option-item input[type="radio"],
.option-item input[type="checkbox"] {
    margin-right: 1rem;
    width: 1.2rem;
    height: 1.2rem;
    accent-color: var(--primary);
    cursor: pointer;
}

.option-item span {
    font-size: 0.95rem;
    font-weight: 500;
}

.option-other {
    margin-top: 0.5rem;
    width: 100%;
}

/* Likert Grid for Academic Scale */
.likert-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    overflow-x: auto;
    display: block;
}

.likert-table th, .likert-table td {
    padding: 0.75rem 1rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.likert-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.likert-table td.statement {
    text-align: left;
    font-weight: 500;
    font-size: 0.95rem;
    min-width: 250px;
}

.likert-table input[type="radio"] {
    width: 1.2rem;
    height: 1.2rem;
    accent-color: var(--primary);
    cursor: pointer;
}

/* Button & Navigations */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.75rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background-color: var(--background);
}

.btn-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2.5rem;
    gap: 1rem;
}

/* Progress bar for multi-step behavior */
.progress-bar-container {
    width: 100%;
    height: 6px;
    background-color: var(--border);
    border-radius: 3px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary);
    width: 0%;
    transition: width 0.4s ease;
}

/* Notification & Messages */
.alert {
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    border: 1px solid transparent;
}

.alert-error {
    background-color: #fef2f2;
    border-color: #fee2e2;
    color: #991b1b;
}

.alert-success {
    background-color: #f0fdf4;
    border-color: #dcfce7;
    color: #166534;
}

/* Results / Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.75rem;
    margin-top: 2rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--secondary);
    border-left: 4px solid var(--primary);
    padding-left: 0.75rem;
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
    text-align: center;
}

.stat-box {
    background: var(--background);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.stat-num {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary);
}

.stat-lbl {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 0.25rem;
}

/* Custom CSS Charts (fallback if no internet for CDN Chart.js) */
.chart-container {
    position: relative;
    height: 220px;
    width: 100%;
}

.bar-chart-row {
    margin-bottom: 0.75rem;
}

.bar-lbl {
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.bar-wrapper {
    height: 10px;
    background-color: var(--border);
    border-radius: 5px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background-color: var(--primary);
    border-radius: 5px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Open ended feedback table */
.academic-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.academic-table th, .academic-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.academic-table th {
    background-color: var(--background);
    color: var(--secondary);
    font-weight: 600;
    font-size: 0.9rem;
}

.academic-table tr:hover {
    background-color: var(--background);
}

/* Footer styling */
footer {
    margin-top: 3rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Responsiveness & Mobile Adaptability (Laptop, Tablet, Phone)
   ========================================================================== */

/* Laptops / Tablets (under 992px) */
@media (max-width: 992px) {
    .container-wide {
        max-width: 100%;
        padding: 1.75rem;
        margin: 1rem auto;
    }
}

/* Tablets / Large Phones (under 768px) */
@media (max-width: 768px) {
    body {
        padding: 1rem 0.5rem;
    }
    .container {
        padding: 1.5rem;
        margin: 1rem auto;
        border-radius: var(--radius-md);
    }
    .container-wide {
        padding: 1.25rem;
        margin: 0.5rem auto;
        border-radius: var(--radius-md);
    }
    .header h1 {
        font-size: 1.5rem;
    }
    .header p {
        font-size: 0.85rem;
    }
    .stats-summary {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    .stat-num {
        font-size: 1.35rem;
    }
    .stat-lbl {
        font-size: 0.65rem;
    }
    .dashboard-grid {
        grid-template-columns: 1fr !important; /* Stack columns on smaller tablet screens */
        gap: 1.25rem;
    }
    .card {
        padding: 1.25rem;
    }
}

/* Small Phones (under 576px) */
@media (max-width: 576px) {
    .stats-summary {
        grid-template-columns: 1fr; /* Stack statistics vertically on phone screens */
        gap: 0.75rem;
    }
    .stat-box {
        padding: 0.75rem;
    }
    .btn-group {
        flex-direction: column;
        gap: 0.75rem;
    }
    .btn {
        width: 100%;
    }
    .likert-table {
        margin-top: 0.5rem;
    }
    .likert-table th, .likert-table td {
        padding: 0.5rem;
    }
}

/* Column Spans for Responsive Dashboard Grids */
.lg-col-span-2 {
    grid-column: span 1;
}

@media (min-width: 992px) {
    .lg-col-span-2 {
        grid-column: span 2;
    }
}

/* Responsive Section Titles */
.section-title {
    margin-top: 3.5rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    color: var(--secondary);
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.5rem;
    font-size: 1.4rem;
}

@media (max-width: 768px) {
    .section-title {
        margin-top: 2rem;
        margin-bottom: 1rem;
        font-size: 1.2rem;
    }
}


