@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800&display=swap');

:root {
    --primary: #0f5132;
    --primary-light: #d1e7dd;
    --primary-hover: #146c43;
    --secondary: #b45309;
    --secondary-hover: #92400e;
    --accent: #d97706;
    --bg-main: #f4f7f6;
    --bg-card: #ffffff;
    --text-main: #212529;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --success: #198754;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #0dcaf0;
    --shadow-sm: 0 .125rem .25rem rgba(0,0,0,.075);
    --shadow-md: 0 .5rem 1rem rgba(0,0,0,.15);
    --shadow-lg: 0 1rem 3rem rgba(0,0,0,.175);
    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Tajawal', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    direction: rtl;
    text-align: right;
    min-height: 100vh;
}

/* Base Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Premium Card Style */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 2.5rem;
    margin-bottom: 2rem;
    transition: var(--transition);
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
}

p {
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Tajawal', sans-serif;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    gap: 0.5rem;
    text-decoration: none;
}

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

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

.btn-secondary {
    background-color: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.btn-secondary:hover {
    background-color: #e2e8f0;
}

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

.btn-danger:hover {
    background-color: #bb2d3b;
}

.btn-warning {
    background-color: var(--warning);
    color: #212529;
}

.btn-warning:hover {
    background-color: #ffca2c;
}

.btn-success {
    background-color: var(--success);
    color: #ffffff;
}

.btn-success:hover {
    background-color: #157347;
}

.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Form Controls */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #344767;
    font-size: 0.95rem;
}

.form-label .required {
    color: var(--danger);
    margin-right: 0.25rem;
}

.form-control, .form-select, textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: 'Tajawal', sans-serif;
    border-radius: 8px;
    border: 1px solid #d2d6da;
    background-color: #ffffff;
    transition: var(--transition);
    color: #495057;
}

.form-control:focus, .form-select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 81, 50, 0.15);
}

/* Radio & Checkbox styling */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
}

.form-check-input {
    width: 1.15rem;
    height: 1.15rem;
    accent-color: var(--primary);
    cursor: pointer;
}

/* Multi-step Wizard Styles */
.wizard-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin-bottom: 3rem;
}

.wizard-progress::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 3px;
    background-color: #e9ecef;
    z-index: 1;
    transform: translateY(-50%);
}

.wizard-progress-bar {
    position: absolute;
    top: 50%;
    right: 0;
    height: 3px;
    background-color: var(--primary);
    z-index: 1;
    transform: translateY(-50%);
    transition: width 0.4s ease;
    width: 0%;
}

.wizard-step {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background-color: #ffffff;
    border: 3px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    z-index: 2;
    transition: var(--transition);
    color: var(--text-muted);
}

.wizard-step.active {
    border-color: var(--primary);
    background-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 0 0 5px rgba(15, 81, 50, 0.15);
}

.wizard-step.completed {
    border-color: var(--primary);
    background-color: #ffffff;
    color: var(--primary);
}

.wizard-step-label {
    position: absolute;
    top: 3rem;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    color: var(--text-muted);
}

.wizard-step.active .wizard-step-label {
    color: var(--primary);
}

.wizard-panel {
    display: none;
    animation: fadeIn 0.4s ease;
}

.wizard-panel.active {
    display: block;
}

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

/* Matrix Table Grid for Experience levels */
.matrix-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

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

.matrix-table th {
    background-color: #f8fafc;
    font-weight: 700;
    color: var(--primary);
}

.matrix-table td:first-child {
    text-align: right;
    font-weight: 600;
    background-color: #f8fafc;
}

/* Form Action Buttons Container */
.form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 2.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

/* File Upload Field */
.file-upload-wrapper {
    position: relative;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    background-color: #f8fafc;
    transition: var(--transition);
    cursor: pointer;
    margin-bottom: 1.5rem;
}

.file-upload-wrapper:hover {
    border-color: var(--primary);
    background-color: #f0fdf4;
}

.file-upload-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.file-upload-text {
    font-weight: 600;
    color: #475569;
}

.file-upload-hint {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 0.25rem;
}

.file-selected-name {
    margin-top: 0.5rem;
    color: var(--success);
    font-weight: 700;
    font-size: 0.9rem;
}

/* Admin/Candidate Layout */
.admin-layout {
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
}

.sidebar {
    width: 250px;
    background-color: #111827;
    color: #ffffff;
    padding: 1.5rem 1rem;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    z-index: 1050;
    transition: var(--transition);
}

.sidebar-brand {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: #10b981;
    text-align: center;
    border-bottom: 1px solid #1f2937;
    padding-bottom: 0.75rem;
}

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

.sidebar-menu-item a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    color: #9ca3af;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.85rem; /* Smaller font size */
    transition: var(--transition);
}

.sidebar-menu-item.active a, .sidebar-menu-item a:hover {
    background-color: #1f2937;
    color: #ffffff;
}

.sidebar-menu-item-header {
    font-size: 0.75rem !important;
    padding: 0.75rem 0.5rem 0.25rem 0.5rem !important;
}

.admin-main {
    flex-grow: 1;
    background-color: #f3f4f6;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.admin-header {
    background-color: #ffffff;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Mobile Toggle Hamburger Button */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #374151;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}

.admin-content {
    padding: 1.5rem;
    flex-grow: 1;
}

/* Metric Cards Dashboard */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-right: 4px solid var(--primary);
}

.metric-card.pending { border-right-color: var(--warning); }
.metric-card.accepted { border-right-color: var(--success); }
.metric-card.rejected { border-right-color: var(--danger); }

.metric-info h3 {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.metric-number {
    font-size: 2rem;
    font-weight: 800;
    color: #111827;
}

.metric-icon {
    font-size: 2.25rem;
    opacity: 0.2;
}

/* Custom Alert Messages */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.alert-success {
    background-color: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}

.alert-danger {
    background-color: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
}

/* Table Design */
.table-wrapper {
    background-color: #ffffff;
    border-radius: var(--radius);
    overflow-x: auto;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e5e7eb;
    margin-bottom: 1.5rem;
}

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

.data-table th, .data-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.data-table th {
    background-color: #f9fafb;
    font-weight: 700;
    color: #374151;
    font-size: 0.9rem;
}

.data-table tr:hover td {
    background-color: #f9fafb;
}

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

.badge-pending { background-color: #fef3c7; color: #d97706; }
.badge-reviewed { background-color: #e0f2fe; color: #0284c7; }
.badge-accepted { background-color: #d1e7dd; color: #0f5132; }
.badge-rejected { background-color: #fde2e2; color: #9b1c1c; }

/* Modal and Status Control */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 2.5rem;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.3s ease;
}

.modal-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.modal-text {
    margin-bottom: 2rem;
    color: #4a5568;
}

/* Detail Info Grid */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.detail-section-title {
    grid-column: 1 / -1;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0.5rem;
    margin-top: 1.5rem;
}

.detail-item {
    background-color: #ffffff;
    padding: 1.25rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.detail-label {
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.detail-value {
    font-size: 1.05rem;
    color: #111827;
    font-weight: 700;
}

.detail-textarea-val {
    white-space: pre-line;
    background: #f9fafb;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    margin-top: 0.25rem;
}

.file-link-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.file-link-title {
    font-weight: 700;
    color: #334155;
}

.file-link-btn {
    text-decoration: none;
    color: var(--primary);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.file-link-btn:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

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

/* Toggle Form Styling in Dashboard */
.status-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    border-right: 4px solid var(--success);
}
.status-banner.closed {
    border-right-color: var(--danger);
}

.status-banner-title {
    font-weight: 800;
    font-size: 1.1rem;
    color: #111827;
}

.status-banner-desc {
    color: #6b7280;
    font-size: 0.9rem;
}

/* Switch styling */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #2196F3;
}

input:focus + .slider {
    box-shadow: 0 0 1px #2196F3;
}

input:checked + .slider:before {
    -webkit-transform: translateX(26px);
    -ms-transform: translateX(26px);
    transform: translateX(26px);
}

/* Responsive adjustments */
@media (max-width: 991px) {
    .menu-toggle {
        display: block; /* Visible on mobile */
    }

    .sidebar {
        position: fixed;
        right: -260px; /* Slide out of screen in RTL */
        top: 0;
        bottom: 0;
        width: 250px;
        height: 100vh;
        box-shadow: var(--shadow-lg);
    }

    .sidebar.open {
        right: 0; /* Slide in */
    }

    .admin-main {
        width: 100%;
    }

    .admin-header {
        padding: 0.75rem 1rem;
    }

    .admin-content {
        padding: 1rem;
    }

    .metrics-grid {
        grid-template-columns: 1fr; /* Single column on small screens */
        gap: 1rem;
    }

    .detail-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .card {
        padding: 1.5rem;
    }
}
