/* --- 1. تعريف هوية الألوان --- */
:root {
    --color-red-primary: #ac232d;
    --color-red-light: #dc222a;
    --color-red-dark: #b21825;
    --color-black-main: #3e3e46;
    --color-white: #ffffff;
    --bg-light: #f8f9fa;
    --border-color: #e0e0e0;
}

/* --- 2. التنسيقات العامة --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg-light);
    color: var(--color-black-main);
    line-height: 1.6;
    padding-bottom: 100px;
}

/* --- 3. ترويسة الموقع --- */
header {
    background: linear-gradient(135deg, var(--color-red-primary) 0%, var(--color-red-dark) 100%);
    color: var(--color-white);
    padding: 1.5rem 0;
    box-shadow: 0 4px 15px rgba(172, 35, 45, 0.2);
}

.container {
    width: 95%;
    max-width: 1200px;
    margin: 0 auto;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 20px;
}

.header-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: white;
    padding: 5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.logo-area h1 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 5px;
    line-height: 1.4;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* --- 4. شريط الخطوات --- */
.steps-container {
    display: flex;
    justify-content: center;
    margin: 30px 0;
}

.step {
    display: flex;
    align-items: center;
    opacity: 0.5;
    font-weight: bold;
    transition: 0.3s;
    cursor: default;
}

.step.active {
    opacity: 1;
    color: var(--color-red-primary);
    transform: scale(1.05);
}

.step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ccc;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    font-size: 1rem;
}

.step.active .step-num {
    background: var(--color-red-primary);
    box-shadow: 0 0 0 4px rgba(172, 35, 45, 0.1);
}

.step-divider {
    width: 40px;
    height: 2px;
    background: #ddd;
    margin: 0 15px;
}

/* --- 5. كروت الدورات (تصميم محسن) --- */
.sector-section {
    background: var(--color-white);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    border-top: 6px solid var(--color-red-primary);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.sector-title {
    font-size: 1.4rem;
    margin-bottom: 25px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
    color: var(--color-red-dark);
    font-weight: 800;
    display: flex;
    align-items: center;
}

.sector-title::before {
    content: '';
    width: 8px;
    height: 30px;
    background: var(--color-red-primary);
    display: inline-block;
    margin-left: 10px;
    border-radius: 4px;
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.course-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    background: #fff;
    transition: all 0.25s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    border-color: #ccaeb0;
}

.course-card.selected {
    background-color: #fff9f9;
    border: 2px solid var(--color-red-primary);
    box-shadow: 0 8px 20px rgba(172, 35, 45, 0.15);
}

.check-icon {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 28px;
    height: 28px;
    background: #fff;
    border: 2px solid #ccc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: 0.2s;
}

.course-card.selected .check-icon {
    background: var(--color-red-primary);
    border-color: var(--color-red-primary);
    color: white;
}

.course-card.selected .check-icon::after {
    content: '✔';
    font-size: 16px;
    font-weight: bold;
}

.course-name {
    font-weight: 800;
    font-size: 1.1rem;
    margin-bottom: 15px;
    line-height: 1.4;
    padding-left: 30px;
}

.badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.info-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-date {
    background: #e3f2fd;
    color: #1565c0;
}

/* Time Badges */
.badge-time-morning {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffe0b2;
}

.badge-time-evening {
    background: #e8eaf6;
    color: #1a237e;
    border: 1px solid #c5cae9;
}

/* TOT Special Color */

.badge-edu {
    background: #f3e5f5;
    color: #7b1fa2;
    border: 1px dashed #ab47bc;
}

.badge-loc {
    background: #e0f2f1;
    color: #00695c;
    width: 100%;
    border: 1px solid #b2dfdb;
    line-height: 1.4;
}

.badge-note {
    background: #ffebee;
    color: #c62828;
    width: 100%;
    margin-top: 5px;
}

.price-tag {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--color-red-primary);
    text-align: left;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px dashed #eee;
}

/* --- 6. حقول رفع الملفات --- */
.upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.file-upload-box {
    position: relative;
    border: 2px dashed #ccc;
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    background: #fafafa;
    transition: 0.3s;
    cursor: pointer;
}

.file-upload-box:hover,
.file-upload-box.has-file {
    background: #fff;
    border-color: var(--color-red-primary);
}

.upload-icon {
    font-size: 2rem;
    color: #888;
    margin-bottom: 10px;
    display: block;
}

.upload-label {
    font-weight: 700;
    color: var(--color-black-main);
    display: block;
    margin-bottom: 5px;
}

.upload-hint {
    font-size: 0.8rem;
    color: #666;
    display: block;
}

.file-input-hidden {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.required-badge {
    position: absolute;
    top: -10px;
    right: 20px;
    background: var(--color-red-primary);
    color: white;
    padding: 2px 10px;
    font-size: 0.75rem;
    border-radius: 20px;
    font-weight: bold;
}

.optional-badge {
    position: absolute;
    top: -10px;
    right: 20px;
    background: #777;
    color: white;
    padding: 2px 10px;
    font-size: 0.75rem;
    border-radius: 20px;
    font-weight: bold;
}

/* --- 7. النماذج والحقول --- */
.form-section-title {
    background-color: #fff0f1;
    color: var(--color-red-dark);
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 25px;
    font-weight: 700;
    border-right: 5px solid var(--color-red-primary);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 15px;
}

.name-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    font-size: 0.9rem;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    transition: border 0.3s;
    font-size: 0.95rem;
}

.input-group input:focus {
    border-color: var(--color-red-primary);
    box-shadow: 0 0 0 3px rgba(172, 35, 45, 0.1);
    outline: none;
}

/* --- 8. العناصر الأخرى --- */
.contact-box {
    background: #3e3e46;
    color: white;
    padding: 15px;
    text-align: center;
    border-radius: 8px;
    margin: 20px 0;
}

.contact-box a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    margin: 0 10px;
}

.map-responsive {
    overflow: hidden;
    padding-bottom: 40%;
    position: relative;
    height: 0;
    border-radius: 8px;
    border: 2px solid #ddd;
    margin: 20px 0;
}

.map-responsive iframe {
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    position: absolute;
}

.sticky-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--color-white);
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
    z-index: 1000;
    border-top: 4px solid var(--color-red-primary);
}

.bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 95%;
    max-width: 1200px;
    margin: 0 auto;
}

.btn-main {
    background-color: var(--color-red-primary);
    color: white;
    padding: 12px 40px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
}

.btn-main:hover {
    background-color: var(--color-red-dark);
    box-shadow: 0 4px 10px rgba(172, 35, 45, 0.3);
}

.btn-main:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-secondary {
    background-color: #f0f2f5;
    color: #333;
    padding: 12px 30px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-left: 10px;
    cursor: pointer;
    font-weight: 600;
}

/* --- 9. Views Animation --- */
.view-section {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.view-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mini-summary {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border-right: 5px solid var(--color-red-primary);
    margin-bottom: 25px;
    font-weight: 600;
}

@media (max-width: 768px) {
    .name-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .map-responsive {
        padding-bottom: 70%;
    }

    .bar-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .btn-main,
    .btn-secondary {
        width: 100%;
        margin: 0;
    }
}