:root {
    --ui-primary: #8d432e;
    --ui-primary-strong: #8f3d26;
    --ui-bg: #f3f6fb;
    --ui-surface: #ffffff;
    --ui-text: #0f172a;
    --ui-muted: #64748b;
    --ui-border: #e2e8f0;
    --ui-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    --ui-radius: 16px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--ui-bg);
    color: var(--ui-text);
    font-family: "Tajawal", "Cairo", system-ui, -apple-system, "Segoe UI", sans-serif;
}

a {
    text-decoration: none;
}

.ui-page {
    min-height: 100vh;
}

.ui-container {
    width: min(1200px, 94%);
    margin-inline: auto;
}

.ui-navbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid var(--ui-border);
}

.ui-navbar .navbar-brand img {
    height: 46px;
    width: auto;
    object-fit: contain;
}

.ui-nav-link {
    font-weight: 600;
    color: #334155;
    padding: 0.5rem 0.8rem;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.ui-nav-link:hover {
    background: #eff6ff;
    color: var(--ui-primary);
}

.ui-nav-link.active {
    background: #dbeafe;
    color: var(--ui-primary-strong);
}

.ui-lang-switch {
    display: inline-flex;
    border: 1px solid var(--ui-border);
    border-radius: 999px;
    overflow: hidden;
}

.ui-lang-switch a {
    padding: 0.35rem 0.8rem;
    color: var(--ui-muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.ui-lang-switch a.active {
    background: #dbeafe;
    color: var(--ui-primary-strong);
}

.ui-main {
    padding: 1.25rem 0 2rem;
}

.ui-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.ui-title {
    margin: 0;
    font-size: clamp(1.2rem, 2vw, 1.65rem);
    font-weight: 800;
}

.ui-subtitle {
    margin: 0;
    color: var(--ui-muted);
    font-size: 0.95rem;
}

.ui-card {
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    box-shadow: var(--ui-shadow);
}

.ui-card-body {
    padding: 1rem;
}

.ui-card-soft {
    border-radius: 14px;
    border: 1px solid var(--ui-border);
    background: #f8fafc;
}

.ui-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 0.62rem 1rem;
    font-weight: 700;
    transition: all 0.2s ease;
}

.ui-btn-primary {
    background: var(--ui-primary);
    color: #fff;
}

.ui-btn-primary:hover {
    background: var(--ui-primary-strong);
    color: #fff;
}

.ui-btn-light {
    border-color: var(--ui-border);
    background: #fff;
    color: #334155;
}

.ui-btn-light:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.ui-btn-danger {
    background: #ef4444;
    color: #fff;
}

.ui-btn-danger:hover {
    background: #dc2626;
    color: #fff;
}

.ui-input,
.ui-select,
.ui-textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 0.65rem 0.8rem;
    background: #fff;
    color: #0f172a;
}

.ui-input:focus,
.ui-select:focus,
.ui-textarea:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
    outline: none;
}

.ui-table-wrap {
    overflow-x: auto;
}

.ui-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.ui-table th,
.ui-table td {
    border-bottom: 1px solid var(--ui-border);
    padding: 0.8rem 0.9rem;
    white-space: nowrap;
}

.ui-table th {
    color: var(--ui-muted);
    font-size: 0.82rem;
}

.ui-table tr:hover td {
    background: #f8fafc;
}

.ui-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 700;
    background: #dbeafe;
    color: #1e40af;
}

/* Welcome page */
.ui-welcome-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    position: relative;
    overflow: hidden;
}

.ui-welcome-gradient {
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 999px;
    filter: blur(68px);
    opacity: 0.45;
    z-index: 0;
}

.ui-welcome-gradient.one {
    background: #93c5fd;
    top: -90px;
    right: -90px;
}

.ui-welcome-gradient.two {
    background: #bfdbfe;
    bottom: -90px;
    left: -90px;
}

.ui-welcome-card {
    position: relative;
    z-index: 1;
    width: min(700px, 94%);
    text-align: center;
    padding: 2rem;
}

.ui-logo-box {
    background: #f8fafc;
    border: 1px solid var(--ui-border);
    border-radius: 14px;
    padding: 1rem;
}

.ui-logo-box img {
    height: 88px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    margin-inline: auto;
}

.ui-job-grid {
    display: grid;
    gap: 0.8rem;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.ui-job-card,
.ui-candidate-card {
    padding: 1rem;
    border: 1px solid var(--ui-border);
    border-radius: 14px;
    background: #fff;
    transition: all 0.2s ease;
}

.ui-job-card:hover,
.ui-candidate-card:hover {
    transform: translateY(-2px);
    border-color: #bfdbfe;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.1);
}

.ui-search {
    position: relative;
}

.ui-search i {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 0.8rem;
    color: #94a3b8;
}

.ui-search .ui-input {
    padding-right: 2.2rem;
}

/* Interview screen */
.ui-interview-navbar {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.ui-interview-shell {
    padding: 1rem 0 5rem;
}

.ui-category-header {
    position: sticky;
    top: 68px;
    z-index: 15;
    background: #f3f6fb;
    padding: 0.5rem 0;
}

.ui-question-card {
    border: 1px solid var(--ui-border);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
    margin-bottom: 0.9rem;
    transition: all 0.2s ease;
}

.ui-question-card:hover {
    box-shadow: 0 12px 25px rgba(15, 23, 42, 0.08);
}

.ui-question-title {
    margin: 0 0 0.75rem;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.7;
}

.ui-score-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.ui-score-btn {
    min-width: 2.9rem;
    min-height: 2.8rem;
    border-radius: 11px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1e3a8a;
    font-weight: 800;
    transition: all 0.15s ease;
}

.ui-score-btn:hover {
    background: #dbeafe;
}

.ui-score-btn.active {
    background: var(--ui-primary);
    color: #fff;
    border-color: var(--ui-primary);
}

.ui-progress-wrap {
    position: sticky;
    bottom: 0.8rem;
    z-index: 1031;
}

.ui-progress-card {
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    border-radius: 14px;
    padding: 0.8rem;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.15);
}

.ui-save-indicator {
    font-size: 0.85rem;
    color: var(--ui-muted);
}

.ui-compact .ui-question-title {
    font-size: 1rem;
    margin-bottom: 0.45rem;
}

.ui-compact .ui-textarea {
    min-height: 80px;
}

@media (max-width: 991px) {
    .ui-category-header {
        top: 60px;
    }

    .ui-welcome-card {
        padding: 1.25rem;
    }
}
