/* assets/style.css */
@font-face {
    font-family: 'IRANSans';
    src: url('/assets/fonts/iransans-thin.woff2') format('woff2');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'IRANSans';
    src: url('/assets/fonts/iransans-ultra-light.woff2') format('woff2');
    font-weight: 200;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'IRANSans';
    src: url('/assets/fonts/iransans-light.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'IRANSans';
    src: url('/assets/fonts/iransans.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary: #5850EC;
    --primary-light: #EEF2FF;
    --primary-hover: #4F46E5;
    --accent: #8B5CF6;
    --accent-light: #F5F3FF;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --text-main: #1F2937;
    --text-muted: #4B5563;
    --bg: #F8FAFC;
    --card: #FFFFFF;
    --border: #E2E8F0;
    --sidebar: #0F172A;
    --sidebar-text: #94A3B8;
    --sidebar-hover: #1E293B;
    
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 20px -2px rgba(0, 0, 0, 0.05), 0 2px 8px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 12px 30px -4px rgba(0, 0, 0, 0.06), 0 4px 12px -2px rgba(0, 0, 0, 0.03);
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    font-size: 13px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'IRANSans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text-main);
    direction: rtl;
    text-align: right;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Utilities */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.grid { display: grid; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.w-full { width: 100%; }
.text-center { text-align: center; }

/* Grid columns */
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.25;
}
p {
    line-height: 1.6;
    color: var(--text-muted);
}

/* Header & Navigation */
header.app-header {
    background-color: var(--card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-inner {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
}

.nav-links a:hover {
    color: var(--primary);
    background-color: var(--primary-light);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-size: 0.95rem;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
    background-color: var(--primary-light);
    color: var(--primary);
}
.btn-secondary:hover {
    background-color: #e0e7ff;
    transform: translateY(-2px);
}

.btn-accent {
    background-color: var(--accent);
    color: white;
}
.btn-accent:hover {
    background-color: #6d28d9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}
.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

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

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

/* Landing Page Hero */
.hero {
    padding: 6rem 0;
    background: radial-gradient(circle at top right, rgba(88, 80, 236, 0.06) 0%, rgba(139, 92, 246, 0.04) 50%, rgba(248, 250, 252, 1) 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -10%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(88, 80, 236, 0.12) 0%, rgba(88, 80, 236, 0) 70%);
    filter: blur(50px);
    z-index: 0;
    pointer-events: none;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 3rem;
    align-items: center;
}

@media (max-width: 992px) {
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

.hero h1 {
    font-size: 3rem;
    color: var(--sidebar);
    margin-bottom: 1rem;
    background: linear-gradient(to left, var(--sidebar), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.15rem;
    margin-bottom: 2rem;
    max-width: 600px;
}

@media (max-width: 992px) {
    .hero p { margin: 0 auto 2rem auto; }
}

/* Layouts with Sidebar */
.dashboard-layout {
    display: flex;
    flex: 1;
    min-height: calc(100vh - 70px);
}

@media (max-width: 768px) {
    .dashboard-layout {
        flex-direction: column;
    }
}

.sidebar {
    width: 240px;
    background-color: var(--sidebar);
    color: var(--sidebar-text);
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        padding: 1rem;
        gap: 1rem;
    }
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: white;
    padding-right: 0.5rem;
    border-right: 3px solid var(--accent);
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

@media (max-width: 768px) {
    .sidebar-menu {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: var(--transition);
}

.sidebar-menu a:hover, .sidebar-menu li.active a {
    color: white;
    background-color: var(--sidebar-hover);
}

.sidebar-menu li.active a {
    background: linear-gradient(135deg, var(--primary), var(--accent));
}

.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

@media (max-width: 576px) {
    .main-content {
        padding: 1rem;
    }
}

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

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-title {
    font-size: 1.15rem;
    margin-bottom: 1rem;
    color: var(--sidebar);
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 0.5rem;
}

/* Stats Cards */
.stat-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.stat-info h3 {
    font-size: 2rem;
    margin-top: 0.25rem;
    color: var(--sidebar);
}

.stat-info p {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-icon {
    font-size: 2.5rem;
    opacity: 0.15;
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

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

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background-color: var(--bg);
    color: var(--text-main);
    font-size: 0.95rem;
    transition: var(--transition);
    text-align: right;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background-color: white;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background-color: white;
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
}

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

table.data-table th {
    background-color: var(--primary-light);
    color: var(--sidebar);
    font-weight: 700;
}

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

table.data-table tr:hover td {
    background-color: var(--bg);
}

.badge {
    display: inline-flex;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-primary { background-color: var(--primary-light); color: var(--primary); }
.badge-success { background-color: #d1fae5; color: #065f46; }
.badge-warning { background-color: #fef3c7; color: #92400e; }
.badge-danger { background-color: #fee2e2; color: #991b1b; }

/* Quiz Styles */
.quiz-container {
    max-width: 700px;
    margin: 2rem auto;
}

.quiz-progress {
    height: 8px;
    background-color: var(--border);
    border-radius: 9999px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.quiz-progress-bar {
    height: 100%;
    background: linear-gradient(to left, var(--primary), var(--accent));
    width: 0%;
    transition: width 0.3s ease;
}

.quiz-question-card {
    background-color: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    text-align: center;
    border: 1px solid var(--border);
}

.quiz-question-text {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--sidebar);
    margin-bottom: 2.5rem;
    min-height: 80px;
    line-height: 1.5;
}

.likert-scale {
    display: flex;
    justify-content: space-between;
    flex-direction: row-reverse; /* Agreement scale layout alignment */
    gap: 0.5rem;
    margin-bottom: 2.5rem;
}

@media (max-width: 576px) {
    .likert-scale {
        flex-direction: column-reverse;
        gap: 0.75rem;
    }
}

.likert-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.likert-button {
    width: 100%;
    padding: 1rem 0.5rem;
    border-radius: var(--radius-md);
    border: 2px solid var(--border);
    background-color: white;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    font-size: 0.9rem;
}

/* Likert Color Gradients on Hover/Select */
/* 5 Options: Strongly Disagree (1), Disagree (2), Neutral (3), Agree (4), Strongly Agree (5) */
.likert-btn-1:hover, .likert-btn-1.selected { background-color: #fef2f2; border-color: #ef4444; color: #b91c1c; }
.likert-btn-2:hover, .likert-btn-2.selected { background-color: #fffbeb; border-color: #f59e0b; color: #b45309; }
.likert-btn-3:hover, .likert-btn-3.selected { background-color: #f3f4f6; border-color: #9ca3af; color: #4b5563; }
.likert-btn-4:hover, .likert-btn-4.selected { background-color: #ecfdf5; border-color: #34d399; color: #047857; }
.likert-btn-5:hover, .likert-btn-5.selected { background-color: #f0fdf4; border-color: #22c55e; color: #15803d; }

.quiz-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
}

.quiz-error {
    color: var(--danger);
    font-weight: 600;
    margin-bottom: 1rem;
    display: none;
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Spinner and Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid var(--primary-light);
    border-top: 5px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Score visualizers */
.score-card {
    background-color: white;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.score-bar-container {
    margin-bottom: 1rem;
}

.score-bar-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.score-bar-bg {
    height: 12px;
    background-color: var(--border);
    border-radius: 9999px;
    overflow: hidden;
}

.score-bar-fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 1s ease-out;
}

.fill-primary { background: linear-gradient(to left, var(--primary), var(--accent)); }
.fill-success { background: linear-gradient(to left, var(--success), #34d399); }
.fill-warning { background: linear-gradient(to left, var(--warning), #fbbf24); }
.fill-danger { background: linear-gradient(to left, var(--danger), #f87171); }

/* Personality comparison meter */
.personality-meter {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
}
.personality-label {
    width: 120px;
    font-weight: 600;
    font-size: 0.85rem;
}
.personality-label.left { text-align: left; }
.personality-label.right { text-align: right; }

.personality-bar-bg {
    flex: 1;
    height: 14px;
    background-color: var(--border);
    border-radius: 9999px;
    position: relative;
    overflow: hidden;
}
.personality-bar-split {
    height: 100%;
    position: absolute;
    right: 0; /* Align right side */
    background: linear-gradient(to left, var(--primary), var(--accent));
    transition: width 1s ease-out;
}

/* Report Formatting in Results */
.report-content {
    background-color: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 2.5rem;
    line-height: 1.8;
}

.report-content h1, .report-content h2, .report-content h3 {
    color: var(--sidebar);
    margin-top: 2rem;
    margin-bottom: 1rem;
    border-right: 5px solid var(--primary);
    padding-right: 0.75rem;
}

.report-content p {
    margin-bottom: 1.25rem;
    font-size: 1.05rem;
    color: var(--text-main);
}

.report-content ul, .report-content ol {
    margin-bottom: 1.5rem;
    padding-right: 1.5rem;
}

.report-content li {
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.pagination a, .pagination span {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text-main);
    background-color: white;
    font-weight: 500;
}

.pagination a:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

.pagination span.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Print Styling */
@media print {
    body {
        background-color: white !important;
        color: black !important;
    }
    .sidebar, .app-header, .no-print, .btn, .pagination {
        display: none !important;
    }
    .main-content {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
    }
    .card, .report-content {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
    }
    .score-bar-bg {
        border: 1px solid #000 !important;
        background-color: #eee !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    .score-bar-fill, .personality-bar-split {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}
