﻿/* ========== Variables ========== */
:root {
    --step-success: #28a745;
    --step-inactive: #6c757d;
    --step-bg: #f8f9fa;
    --step-border: #dee2e6;
}

/* ========== Container ========== */
.step-navigation-wrapper {
    margin: 20px auto 30px;
    direction: ltr !important;
    text-align: center !important;
}

.step-nav-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    border: none;
    direction: ltr !important;
}

/* ألوان الكارت - Hot */
.permit-hot .step-nav-card {
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.15);
    border-top: 3px solid #dc3545;
}

/* ألوان الكارت - Cold */
.permit-cold .step-nav-card {
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.15);
    border-top: 3px solid #0d6efd;
}

/* ========== Steps Container ========== */
.steps-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: row-reverse !important;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 10px 0;
}

    .steps-container::-webkit-scrollbar {
        height: 6px;
    }

    .steps-container::-webkit-scrollbar-track {
        background: var(--step-bg);
        border-radius: 10px;
    }

/* Scrollbar - Hot */
.permit-hot .steps-container::-webkit-scrollbar-thumb {
    background: #dc3545;
    border-radius: 10px;
}

/* Scrollbar - Cold */
.permit-cold .steps-container::-webkit-scrollbar-thumb {
    background: #0d6efd;
    border-radius: 10px;
}

/* ========== Step Item ========== */
.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-width: 100px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 5px;
}

    .step-item:hover .step-circle {
        transform: scale(1.1);
    }

.permit-hot .step-item:hover .step-circle {
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.permit-cold .step-item:hover .step-circle {
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

/* ========== Step Circle ========== */
.step-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 3px solid var(--step-inactive);
    color: var(--step-inactive);
    font-weight: 700;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    z-index: 2;
}

/* Active Circle - Hot */
.permit-hot .step-item.active .step-circle {
    background: linear-gradient(135deg, #dc3545, #c82333);
    border-color: #dc3545;
    color: white;
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.2);
    animation: pulseRed 2s infinite;
}

/* Active Circle - Cold */
.permit-cold .step-item.active .step-circle {
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    border-color: #0d6efd;
    color: white;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.2);
    animation: pulseBlue 2s infinite;
}

.step-item.completed .step-circle {
    background: var(--step-success);
    border-color: var(--step-success);
    color: white;
}

.step-circle i {
    font-size: 1.5rem;
}

/* Pulse Animations Desktop */
@keyframes pulseRed {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.2);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(220, 53, 69, 0.1);
    }
}

@keyframes pulseBlue {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.2);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(13, 110, 253, 0.1);
    }
}

/* ========== Step Label ========== */
.step-label {
    text-align: center !important;
    direction: ltr !important;
    min-width: 80px;
}

    .step-label small {
        display: block;
        direction: ltr !important;
        line-height: 1.3;
        font-weight: 600;
    }

        .step-label small:first-child {
            color: var(--step-inactive);
            font-size: 0.85rem;
        }

        .step-label small.text-muted {
            color: #adb5bd !important;
            font-size: 0.75rem;
        }

/* Active Label - Hot */
.permit-hot .step-item.active .step-label small:first-child {
    color: #dc3545;
}

/* Active Label - Cold */
.permit-cold .step-item.active .step-label small:first-child {
    color: #0d6efd;
}

.step-item.completed .step-label small:first-child {
    color: var(--step-success);
}

/* ========== Connector Line ========== */
.step-connector {
    flex: 1;
    height: 4px;
    background: #e0e0e0;
    margin: 0 15px;
    direction: ltr !important;
    position: relative;
}

    .step-connector::after {
        content: '◀';
        position: absolute;
        left: -8px;
        top: 50%;
        transform: translateY(-50%);
        color: #e0e0e0;
        font-size: 16px;
    }

    .step-connector.completed {
        background: linear-gradient(to left, #28a745, #20c997);
    }

        .step-connector.completed::after {
            color: #28a745;
        }

/* ========== Desktop ========== */
@media (min-width: 992px) {
    .step-navigation-wrapper {
        max-width: calc(100vw - 270px);
        padding: 0 20px;
    }
}

/* ========== Tablet ========== */
@media (max-width: 991.98px) and (min-width: 768px) {
    .step-navigation-wrapper {
        margin-top: 90px !important;
        max-width: 100%;
        padding: 0 20px;
    }

    .step-nav-card {
        padding: 20px;
    }

    .step-circle {
        width: 42px;
        height: 42px;
        font-size: 1.05rem;
    }

    .step-connector {
        max-width: 50px;
    }
}
/* ========== Mobile (أقل من 768px) ========== */
@media (max-width: 767.98px) {
    /* إخفاء الكارت الكامل */
    .step-navigation-wrapper {
        display: none !important;
    }

    /* إظهار الشريط المبسط */
    .mobile-step-navigation {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        background: #dfd25b;
        padding: 12px 15px;
        margin: 85px 10px 15px;
        border-radius: 12px;
        gap: 15px;
    }

    /* أزرار التنقل - Hot */
    .permit-hot .mobile-step-btn {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        border: 2px solid #dc3545;
        background: white;
        color: #dc3545;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s;
        flex-shrink: 0;
    }

        .permit-hot .mobile-step-btn:active {
            transform: scale(0.95);
        }

        .permit-hot .mobile-step-btn:disabled {
            border-color: #dee2e6;
            color: #dee2e6;
            cursor: not-allowed;
            opacity: 0.5;
        }

        .permit-hot .mobile-step-btn:not(:disabled):hover {
            background: #dc3545;
            color: white;
        }

    /* أزرار التنقل - Cold */
    .permit-cold .mobile-step-btn {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        border: 2px solid #0d6efd;
        background: white;
        color: #0d6efd;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s;
        flex-shrink: 0;
    }

        .permit-cold .mobile-step-btn:active {
            transform: scale(0.95);
        }

        .permit-cold .mobile-step-btn:disabled {
            border-color: #dee2e6;
            color: #dee2e6;
            cursor: not-allowed;
            opacity: 0.5;
        }

        .permit-cold .mobile-step-btn:not(:disabled):hover {
            background: #0d6efd;
            color: white;
        }

    .mobile-step-btn i {
        font-size: 1rem;
    }

    /* معلومات الخطوة */
    .mobile-step-current {
        flex: 1;
        display: flex;
        align-items: center;
        gap: 12px;
    }

    /* رقم الخطوة - Hot */
    .permit-hot .mobile-step-number {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background: linear-gradient(135deg, #dc3545, #c82333);
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.4rem;
        font-weight: 700;
        flex-shrink: 0;
        animation: pulseRedMobile 2s ease-in-out infinite;
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }

    /* رقم الخطوة - Cold */
    .permit-cold .mobile-step-number {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background: linear-gradient(135deg, #0d6efd, #0a58ca);
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.4rem;
        font-weight: 700;
        flex-shrink: 0;
        animation: pulseBlueMobile 2s ease-in-out infinite;
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.7);
    }

    /* تأثير النبض - أحمر */
    @keyframes pulseRedMobile {
        0% {
            box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
        }

        50% {
            box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
        }

        100% {
            box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
        }
    }

    /* تأثير النبض - أزرق */
    @keyframes pulseBlueMobile {
        0% {
            box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.7);
        }

        50% {
            box-shadow: 0 0 0 10px rgba(13, 110, 253, 0);
        }

        100% {
            box-shadow: 0 0 0 0 rgba(13, 110, 253, 0);
        }
    }

    .mobile-step-info {
        display: flex;
        flex-direction: column;
        gap: 3px;
        flex: 1;
        min-width: 0;
    }

    .mobile-step-title {
        font-size: 0.95rem;
        font-weight: 700;
        color: #2c3e50;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-step-count {
        font-size: 0.75rem;
        color: #6c757d;
    }

    /* خلفية الشريط - Hot */
    .permit-hot .mobile-step-navigation {
        box-shadow: 0 2px 10px rgba(220, 53, 69, 0.15);
        border-top: 3px solid #dc3545;
    }

    /* خلفية الشريط - Cold */
    .permit-cold .mobile-step-navigation {
        box-shadow: 0 2px 10px rgba(13, 110, 253, 0.15);
        border-top: 3px solid #0d6efd;
    }
}

/* موبايل صغير جداً */
@media (max-width: 575.98px) {
    .mobile-step-navigation {
        margin: 90px 8px 12px;
        padding: 10px 12px;
    }

    .mobile-step-btn {
        width: 36px;
        height: 36px;
    }

    .permit-hot .mobile-step-number,
    .permit-cold .mobile-step-number {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }

    .mobile-step-title {
        font-size: 0.85rem;
    }

    .mobile-step-count {
        font-size: 0.7rem;
    }

    /* تقليل النبض */
    @keyframes pulseRedMobile {
        0% {
            box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
        }

        50% {
            box-shadow: 0 0 0 8px rgba(220, 53, 69, 0);
        }

        100% {
            box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
        }
    }

    @keyframes pulseBlueMobile {
        0% {
            box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.7);
        }

        50% {
            box-shadow: 0 0 0 8px rgba(13, 110, 253, 0);
        }

        100% {
            box-shadow: 0 0 0 0 rgba(13, 110, 253, 0);
        }
    }
}
