/* ===========================================================
   DASHBOARD COMMERÇANT - STYLES GLOBAUX
   =========================================================== */

.dashboard-header {
    margin-bottom: 4rem;
    text-align: center;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2.5rem;
}

.dashboard-card {
    background: var(--bg-card);
    border-radius: 1.25rem;
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.dashboard-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.placeholder-img {
    width: 100%;
    height: 100%;
    background: #1e293b;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
}

.card-status {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    backdrop-filter: blur(8px);
}

.status-active {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-inactive {
    background: rgba(249, 115, 22, 0.2);
    color: #fdba74;
    border: 1px solid rgba(249, 115, 22, 0.3);
}

.status-pending {
    background: rgba(234, 179, 8, 0.2);
    color: #facc15;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.card-inactive .card-image img {
    filter: grayscale(100%);
    opacity: 0.6;
}

.card-inactive {
    border-color: var(--border-color) !important;
}

.card-content {
    padding: 2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.card-cat {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.card-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: auto;
}

.card-actions .btn {
    width: 100%;
    text-align: center;
    justify-content: center;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dashboard-card .btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: white;
}

.dashboard-card .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--secondary-color);
}

.card-stats {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 5rem 2rem;
    background: var(--bg-card);
    border-radius: 1.25rem;
    border: 2px dashed var(--border-color);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
}

/* ===========================================================
   FORMULAIRES D'ÉDITION ET AJOUT
   =========================================================== */


/* ===========================================================
   NAVIGATION PAR ONGLETS (TABS)
   =========================================================== */

.dashboard-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    background: rgba(15, 23, 42, 0.4);
    padding: 0.5rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.tab-link {
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    color: var(--text-muted);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-link:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.tab-link.active {
    background: var(--primary-color) !important;
    color: white !important;
    box-shadow: var(--shadow-md) !important;
}

.container-sm {
    max-width: 900px !important;
}

.edit-header {
    margin-bottom: 3rem;
    text-align: center;
}

.back-link {
    display: inline-block;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-weight: 500;
    transition: var(--transition);
}

.back-link:hover {
    transform: translateX(-5px);
}

.edit-form,
.modern-form-card {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(20px);
    border-radius: 32px;
    padding: 4rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    margin-bottom: 4rem;
}

.form-section {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.section-label {
    color: var(--secondary-color);
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 2rem;
    text-transform: none;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--secondary-color);
}

/* Style direct pour les éléments du formulaire */
.form-control,
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(2, 6, 23, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input[type="file"] {
    padding: 0.6rem;
    font-size: 0.9rem;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    cursor: pointer;
}

.form-control:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(2, 6, 23, 0.8);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.image-edit-container {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.current-image img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.current-image p {
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

/* Fix pour éviter que le lien du nom de fichier ne sorte du cadre */
.image-edit-container a {
    display: block;
    max-width: 300px;
    /* Limite la largeur */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* Ajoute "..." */
    color: var(--primary-color);
    font-size: 0.9rem;
}

.hours-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.day-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    align-items: center;
    gap: 2rem;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.day-name {
    font-weight: 600;
    color: var(--text-main);
}

.day-inputs {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.day-inputs input[type="time"] {
    max-width: 130px;
}

.sep {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.checkbox-label,
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Modification pour les boutons radios (Produit / Service) */
.radio-wrapper {
    display: inline-flex;
    padding: 0.4rem;
    background: rgba(2, 6, 23, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    width: fit-content;
}

.radio-wrapper ul,
.radio-wrapper .radio-list {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 0.5rem;
}

.radio-wrapper li,
.radio-wrapper div {
    position: relative;
    display: flex;
    align-items: center;
}

.radio-wrapper input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
    margin: 0;
}

.radio-wrapper label {
    display: block;
    padding: 0.6rem 2rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.3s ease;
    margin-bottom: 0 !important;
    position: relative;
    z-index: 1;
    white-space: nowrap;
}

.radio-wrapper input[type="radio"]:checked+label,
.radio-wrapper label:has(input[type="radio"]:checked) {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.radio-wrapper label:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.radio-wrapper input[type="radio"]:checked+label:hover,
.radio-wrapper label:has(input[type="radio"]:checked):hover {
    background: var(--primary-color);
}

.checkbox-wrapper {
    padding: 0.875rem;
    background: rgba(2, 6, 23, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

/* Custom file input */
.file-input {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.file-input-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.1rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.file-input-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
}

.file-input-btn input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.file-input-name {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.current-file {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.current-file-label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.clear-file {
    margin-bottom: 0.75rem;
}

.form-actions-inline {
    margin-top: 3rem;
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    align-items: center;
}

.btn-md {
    padding: 0.875rem 2rem;
    font-size: 1rem;
    border-radius: 8px;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ===========================================================
   GESTION DES PRODUITS / SERVICES (OFFRES)
   =========================================================== */

.offers-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
    margin-bottom: 4rem;
}

.offers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.offer-item {
    padding: 0;
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.offer-item:hover {
    transform: translateY(-4px);
    border-color: var(--primary-color);
}

.offer-img {
    height: 160px;
    position: relative;
    border-bottom: 1px solid var(--border-color);
}

.offer-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.offer-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    backdrop-filter: blur(4px);
}

.badge-produit {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-service {
    background: rgba(168, 85, 247, 0.2);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.offer-status {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    backdrop-filter: blur(4px);
}

.offer-status-inactive {
    background: rgba(249, 115, 22, 0.2);
    color: #fdba74;
    border: 1px solid rgba(249, 115, 22, 0.3);
}

.offer-inactive {
    opacity: 0.6;
}

.offer-inactive .offer-img img {
    filter: grayscale(100%);
}

.offer-inactive:hover {
    transform: none;
    border-color: var(--border-color);
}

.offer-info {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.offer-info h4 {
    margin-bottom: 0.5rem;
    font-size: 1.125rem;
    color: var(--text-main);
}

.offer-price {
    font-weight: 700;
    color: var(--accent-color);
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.offer-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
    justify-content: flex-end;
}

.btn-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 1rem;
    transition: var(--transition);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}

.empty-state-mini {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem;
    color: var(--text-muted);
    font-style: italic;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 20px;
    border: 1px dashed var(--border-color);
}

/* ===========================================================
   ANIMATIONS & RESPONSIVE
   =========================================================== */

.animate-fadeIn {
    animation: fadeIn 0.5s ease-out backwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1024px) {
    .offers-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {

    .edit-form,
    .modern-form-card {
        padding: 2rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

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

    .day-inputs {
        flex-wrap: wrap;
    }

    .image-edit-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-actions-inline {
        flex-direction: column;
    }

    .form-actions-inline .btn {
        width: 100%;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* ===========================================================
   MODALE DE CONFIRMATION PERSONNALISÉE
   =========================================================== */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.custom-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.custom-modal {
    background: #0f172a;
    border: 1px solid var(--border-color);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border-radius: 24px;
    padding: 3rem;
    width: 90%;
    max-width: 480px;
    text-align: center;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.custom-modal-overlay.active .custom-modal {
    transform: scale(1) translateY(0);
}

.modal-icon-wrapper {
    width: 80px;
    height: 80px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2.5rem;
    color: #ef4444;
}

.modal-title {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    font-family: 'Outfit', sans-serif;
}

.modal-text {
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    font-size: 1rem;
    line-height: 1.6;
}

.modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.btn-modal-cancel {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.875rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-modal-cancel:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--secondary-color);
}

.btn-modal-confirm {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-modal-confirm:hover {
    background: #dc2626;
    transform: translateY(-2px);
    color: white;
}

.visibility-title {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}
