/* ============================================================
   بوابة توظيف - المجد للإلكترونيات
   الهوية البصرية: أزرق داكن + ذهبي + أبيض
   ============================================================ */

:root {
    --color-navy: #1a2b4a;
    --color-navy-light: #24395e;
    --color-gold: #c9a227;
    --color-gold-light: #e0bd4a;
    --color-white: #ffffff;
    --color-bg: #f5f6f8;
    --color-text: #2a2a2a;
    --color-text-light: #6b7280;
    --color-border: #e2e5eb;
    --color-success: #1e8e3e;
    --color-warning: #b7860b;
    --color-danger: #c62828;
    --radius: 10px;
    --shadow: 0 2px 10px rgba(26, 43, 74, 0.08);
    --shadow-lg: 0 8px 30px rgba(26, 43, 74, 0.14);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Cairo', 'Tahoma', sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    direction: rtl;
    text-align: right;
    line-height: 1.7;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ----------------- Header / Navbar ----------------- */
.site-header {
    background: var(--color-navy);
    color: var(--color-white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--color-white);
}

.brand .brand-mark {
    background: var(--color-gold);
    color: var(--color-navy);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.brand small {
    display: block;
    font-size: 0.7rem;
    font-weight: 400;
    color: #cfd6e4;
}

.nav-links {
    display: flex;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    padding: 8px 16px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    background: rgba(255, 255, 255, 0.12);
    color: var(--color-gold-light);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--color-white);
    font-size: 1.6rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }
    .nav-links {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        background: var(--color-navy);
        flex-direction: column;
        padding: 10px 20px 16px;
        display: none;
    }
    .nav-links.open {
        display: flex;
    }
}

/* ----------------- Buttons ----------------- */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s, color 0.15s;
    text-align: center;
}

.btn-gold {
    background: var(--color-gold);
    color: var(--color-navy);
}

.btn-gold:hover {
    background: var(--color-gold-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-navy {
    background: var(--color-navy);
    color: var(--color-white);
}

.btn-navy:hover {
    background: var(--color-navy-light);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border-color: var(--color-navy);
    color: var(--color-navy);
}

.btn-outline:hover {
    background: var(--color-navy);
    color: var(--color-white);
}

.btn-danger {
    background: var(--color-danger);
    color: var(--color-white);
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-sm {
    padding: 6px 16px;
    font-size: 0.85rem;
}

/* ----------------- Hero ----------------- */
.hero {
    background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-navy-light) 100%);
    color: var(--color-white);
    padding: 80px 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.4rem;
    margin: 0 0 16px;
    font-weight: 800;
}

.hero p {
    font-size: 1.15rem;
    color: #d6dbe8;
    max-width: 640px;
    margin: 0 auto 32px;
}

/* ----------------- Sections ----------------- */
.section {
    padding: 60px 0;
}

.section-title {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--color-navy);
    margin-bottom: 10px;
}

.section-subtitle {
    text-align: center;
    color: var(--color-text-light);
    margin-bottom: 40px;
}

.about-box {
    background: var(--color-white);
    border-radius: var(--radius);
    padding: 36px;
    box-shadow: var(--shadow);
    border-top: 4px solid var(--color-gold);
}

.about-box p {
    margin: 0 0 12px;
    font-size: 1.05rem;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.tag {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-navy);
}

/* ----------------- Cards Grid ----------------- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
}

.feature-card {
    background: var(--color-white);
    border-radius: var(--radius);
    padding: 28px 20px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

.feature-card:hover {
    transform: translateY(-4px);
}

.feature-card .icon {
    font-size: 2.2rem;
    margin-bottom: 12px;
}

.feature-card h3 {
    margin: 0 0 8px;
    color: var(--color-navy);
    font-size: 1.1rem;
}

.feature-card p {
    margin: 0;
    color: var(--color-text-light);
    font-size: 0.92rem;
}

/* ----------------- Job Cards ----------------- */
.job-card {
    background: var(--color-white);
    border-radius: var(--radius);
    padding: 26px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    border-right: 5px solid var(--color-gold);
}

.job-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.job-card h3 {
    margin: 0 0 6px;
    color: var(--color-navy);
    font-size: 1.25rem;
}

.job-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--color-text-light);
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

.badge-navy {
    background: rgba(26, 43, 74, 0.1);
    color: var(--color-navy);
}

.badge-gold {
    background: rgba(201, 162, 39, 0.15);
    color: var(--color-warning);
}

.job-desc {
    color: var(--color-text);
    margin-bottom: 16px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-light);
}

/* ----------------- Forms ----------------- */
.form-card {
    background: var(--color-white);
    border-radius: var(--radius);
    padding: 34px;
    box-shadow: var(--shadow);
    max-width: 640px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--color-navy);
    font-size: 0.95rem;
}

.form-group .hint {
    display: block;
    font-weight: 400;
    color: var(--color-text-light);
    font-size: 0.8rem;
    margin-top: 4px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.98rem;
    background: var(--color-white);
    color: var(--color-text);
    transition: border-color 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-gold);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.error-msg {
    color: var(--color-danger);
    font-size: 0.85rem;
    margin-top: 6px;
    display: block;
}

.field-error input,
.field-error select {
    border-color: var(--color-danger);
}

/* ----------------- Alerts ----------------- */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 0.95rem;
}

.alert-success {
    background: #e6f4ea;
    color: var(--color-success);
    border: 1px solid #b7dfc2;
}

.alert-danger {
    background: #fdecea;
    color: var(--color-danger);
    border: 1px solid #f5c2be;
}

.alert-warning {
    background: #fdf3d9;
    color: var(--color-warning);
    border: 1px solid #f0dca0;
}

/* ----------------- Footer ----------------- */
.site-footer {
    background: var(--color-navy);
    color: #cfd6e4;
    padding: 36px 0;
    text-align: center;
    font-size: 0.9rem;
    margin-top: 60px;
}

.site-footer strong {
    color: var(--color-white);
}

.site-footer .footer-links {
    margin: 12px 0;
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
}

.site-footer .footer-links a:hover {
    color: var(--color-gold-light);
}

/* ----------------- Utility ----------------- */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* ----------------- Test / Exam ----------------- */
.test-timer-bar {
    position: sticky;
    top: 0;
    z-index: 200;
    background: var(--color-navy);
    color: var(--color-white);
    padding: 12px 0;
    text-align: center;
    box-shadow: var(--shadow);
}

.test-timer-bar .timer-label {
    font-size: 0.9rem;
    color: #cfd6e4;
    margin-left: 8px;
}

.test-timer-bar #timerDisplay {
    font-weight: 900;
    font-size: 1.3rem;
    color: var(--color-gold-light);
    letter-spacing: 1px;
}

.test-timer-bar.timer-danger #timerDisplay {
    color: #ff8a80;
}

.progress-wrap {
    max-width: 720px;
    margin: 24px auto 10px;
    padding: 0 20px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin-bottom: 8px;
    font-weight: 700;
}

.progress-track {
    background: var(--color-border);
    border-radius: 20px;
    height: 10px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, var(--color-gold) 0%, var(--color-gold-light) 100%);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
}

.test-card {
    max-width: 720px;
    margin: 0 auto;
    background: var(--color-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 34px;
}

.test-card .category-badge {
    display: inline-block;
    margin-bottom: 14px;
}

.test-question {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-navy);
    margin-bottom: 24px;
    line-height: 1.8;
}

.option-item {
    display: block;
    margin-bottom: 12px;
}

.option-item label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    transition: border-color 0.15s, background 0.15s;
}

.option-item input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-gold);
    flex-shrink: 0;
}

.option-item label:hover {
    border-color: var(--color-gold);
    background: #fdf8ec;
}

.option-item input[type="radio"]:checked + span,
.option-item label:has(input[type="radio"]:checked) {
    border-color: var(--color-gold);
    background: #fdf8ec;
}

.test-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 28px;
    gap: 12px;
}

.test-nav .btn {
    flex: 1;
}

.question-block {
    display: none;
}

.question-block.active {
    display: block;
}

/* ----------------- Admin: Login ----------------- */
.login-wrap {
    max-width: 420px;
    margin: 60px auto;
}

/* ----------------- Admin: Stat Cards ----------------- */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--color-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    text-align: center;
    border-top: 4px solid var(--color-gold);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 900;
    color: var(--color-navy);
}

.stat-card .stat-label {
    color: var(--color-text-light);
    font-size: 0.9rem;
    margin-top: 6px;
}

.stat-table {
    background: var(--color-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 30px;
}

.stat-table h3 {
    margin-top: 0;
    color: var(--color-navy);
}

/* ----------------- Admin: Filters Bar ----------------- */
.filters-bar {
    background: var(--color-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    align-items: end;
}

.filters-bar .form-group {
    margin-bottom: 0;
}

.filters-bar label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-navy);
    display: block;
    margin-bottom: 6px;
}

/* ----------------- Admin: Data Table ----------------- */
.table-wrap {
    background: var(--color-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: right;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.92rem;
    white-space: nowrap;
}

.data-table th {
    background: var(--color-navy);
    color: var(--color-white);
    font-weight: 700;
    position: sticky;
    top: 0;
}

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

.data-table a {
    color: var(--color-navy);
    font-weight: 700;
    text-decoration: underline;
}

/* ----------------- Admin: Score Badge ----------------- */
.score-badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 0.85rem;
}

.score-high {
    background: #e6f4ea;
    color: var(--color-success);
}

.score-mid {
    background: #fdf3d9;
    color: var(--color-warning);
}

.score-low {
    background: #fdecea;
    color: var(--color-danger);
}

.score-none {
    background: var(--color-bg);
    color: var(--color-text-light);
}

/* ----------------- Admin: Status Badge / Select ----------------- */
.status-select {
    padding: 8px 12px;
    border-radius: var(--radius);
    border: 1.5px solid var(--color-border);
    font-family: inherit;
    font-weight: 700;
    font-size: 0.85rem;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 800;
}

.status-new { background: #e3ecfb; color: #1a56c4; }
.status-reviewing { background: #fdf3d9; color: var(--color-warning); }
.status-interview { background: #e9def7; color: #6a2ba8; }
.status-accepted { background: #e6f4ea; color: var(--color-success); }
.status-rejected { background: #fdecea; color: var(--color-danger); }

/* ----------------- Admin: Detail View ----------------- */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.detail-item {
    background: var(--color-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
}

.detail-item .label {
    color: var(--color-text-light);
    font-size: 0.82rem;
    margin-bottom: 4px;
}

.detail-item .value {
    color: var(--color-navy);
    font-weight: 700;
    font-size: 1.05rem;
}

.answer-review-item {
    background: var(--color-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 14px;
    border-right: 5px solid var(--color-border);
}

.answer-review-item.correct {
    border-right-color: var(--color-success);
}

.answer-review-item.incorrect {
    border-right-color: var(--color-danger);
}

.answer-review-item.unanswered {
    border-right-color: var(--color-text-light);
}

.btn-whatsapp {
    background: #25d366;
    color: var(--color-white);
}

.btn-whatsapp:hover {
    background: #1ebd5a;
    transform: translateY(-2px);
}

.action-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.section-block {
    background: var(--color-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
    margin-bottom: 24px;
}

.section-block h3 {
    margin-top: 0;
    color: var(--color-navy);
}

.inline-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
