/* User Profile Styles */
.user-profile-container {
    margin: 0 auto;
    padding: 0;

    /* Styles spécifiques pour les sections dans les tabs */
    .tab-section {
        padding: 20px 0;

        h2 {
            color: var(--primary-color);
            font-size: 26px;
            font-weight: 700;
            margin-bottom: 20px;
            margin-top: 0;
        }

        .section-description {
            color: var(--text-muted);
            font-size: 1rem;
            margin: 0;
        }
    }

    .user-profile-header {
        border-bottom: 1px solid var(--primary-color);
        padding-bottom: 20px;
        margin-top:20px;
        display: flex;
        justify-content: space-between;
        align-items: center;

        h1 {
            font-size: 30px;
            font-weight: 600;
            color: var(--primary-black);
            margin: 0;
            display: flex;
            align-items: center;
            gap: 10px;
            line-height: 100%;
        }

        img {
            width: 32px;
            height: 32px;
            filter: invert(27%) sepia(70%) saturate(4111%) hue-rotate(221deg) brightness(101%) contrast(101%);
        }

        .profile-actions {
            .logout-btn {
                background: var(--danger-color);
                color: var(--white);
                border: none;
                padding: 8px 16px;
                border-radius: 6px;
                text-decoration: none;
                font-size: 0.875rem;
                font-weight: 500;
                transition: all 0.3s;
                display: inline-flex;
                align-items: center;
                gap: 8px;

                &:hover {
                    background: var(--danger-hover);
                    transform: translateY(-1px);
                }
            }
        }
    }

    h2 {
        color: var(--primary-color);
        font-size: 26px;
        font-weight: 700;
        margin-bottom: 20px;
        margin-top: 40px;
    }

    /* Section Informations personnelles */
    .personal-info-section {
        padding-bottom: 40px;
        border-bottom: 1px solid #E6E6E6;
        margin-bottom: 2rem;
    }

    .personal-info-header {
        margin-bottom: 1.5rem;
        
        h3 {
            margin: 0 0 0.5rem 0;
            color: var(--text-primary);
            font-size: 1.25rem;
            font-weight: 600;
        }
        
        p {
            margin: 0;
            color: var(--text-muted);
            font-size: 0.875rem;
            line-height: 1.5;
        }
    }

    .personal-info-form {
        width: 100%;
    }

    .form-row {
        display: flex;
        gap: 1rem;
        margin-bottom: 1rem;
        
        .form-group {
            flex: 1;
            margin-bottom: 0;
            &.half { width: 50%; }
        }
        
        /* Pour les champs qui prennent toute la largeur */
        &.form-row-full .form-group {
            flex: none;
            width: 100%;
        }
        
        /* Responsive : empiler les champs sur mobile */
        @media (max-width: 768px) {
            flex-direction: column;
            gap: 0;
            
            .form-group {
                margin-bottom: 1rem;
                &.half { width: 100%; }
            }
        }
    }

    .personal-info-content {
        display: flex;
        align-items: flex-start;
        gap: 40px;

        .personal-info-info {
            width: 40%;

            h3 {
                color: var(--primary-black);
                font-size: 16px;
                font-weight: 600;
                margin: 0 0 4px 0;
            }

            p {
                color: #979797;
                font-size: 14px;
                line-height: 1.5;
                margin: 0;
            }
        }

        .personal-info-form {
            width: 60%;

            .profile-form {
                .form-group {
                    margin-bottom: 24px;

                    label {
                        display: block;
                        margin-bottom: 8px;
                        color: var(--text-primary);
                        font-weight: 500;
                        font-size: 0.875rem;
                    }

                    input[type="text"],
                    input[type="email"],
                    input[type="tel"] {
                        width: 100%;
                        padding: 12px 16px;
                        border: 2px solid var(--border-light);
                        border-radius: 8px;
                        font-size: 1rem;
                        transition: all 0.3s;
                        background: var(--bg-secondary);
                        box-sizing: border-box;

                        &:focus {
                            outline: none;
                            border-color: var(--primary-color);
                            background: var(--white);
                            box-shadow: 0 0 0 3px var(--primary-focus);
                        }

                        &:hover {
                            border-color: var(--border-medium);
                        }

                        &.modified {
                            border-color: var(--primary-color);
                            background: var(--primary-light);
                        }

                        &.saved {
                            border-color: var(--success-color);
                            background: var(--success-light);
                        }
                    }
                }

                .form-actions {
                    display: flex;
                    gap: 16px;
                    margin-top: 30px;
                    padding-top: 20px;
                    border-top: 1px solid var(--border-light);
                }
            }
        }
    }

    /* Section Signature */
    .signature-section {
        padding: 40px 0;
        border-bottom: 1px solid #E6E6E6;

        .signature-content {
            display: flex;
            align-items: flex-start;
            gap: 40px;

            .signature-info {
                width: 40%;

                h3 {
                    color: var(--primary-black);
                    font-size: 16px;
                    font-weight: 600;
                    margin: 0 0 4px 0;
                }

                p {
                    color: #979797;
                    font-size: 14px;
                    line-height: 1.5;
                    margin: 0;
                }
            }

            .signature-preview {
                width: 60%;
                height: 160px;
                background-size: cover;
                background-position: center;
                background-repeat: no-repeat;
                border-radius: 12px;
                border: 2px solid var(--border-light);
                position: relative;
                overflow: hidden;
                display: flex;
                align-items: center;
                justify-content: center;

                .signature-image {
                    max-width: 100%;
                    max-height: 100%;
                    border-radius: 8px;
                }

                .no-signature {
                    color: var(--text-muted);
                    text-align: center;
                    padding: 40px 20px;

                    i {
                        font-size: 3rem;
                        margin-bottom: 16px;
                        color: var(--border-medium);
                    }

                    p {
                        margin: 0;
                        font-size: 1rem;
                    }
                }

                .edit-signature-btn {
                    background: var(--primary-color);
                    color: var(--white);
                    margin-top: 1rem;
                    position: absolute;
                    top: 50%;
                    left: 50%;
                    transform: translate(-50%, -50%);
                    border: 1px solid var(--white);
                    padding: 10px 20px;
                    border-radius: 10px;
                    cursor: pointer;
                    font-size: 14px;
                    font-weight: 500;
                    transition: all 0.3s;
                    backdrop-filter: blur(10px);

                    &:hover {
                        transform: translate(-50%, -50%) scale(1.05);
                        box-shadow: 0 4px 12px var(--primary-shadow);
                    }

                    i {
                        margin-right: 8px;
                    }
                }
            }
        }
    }

/* Zone d'intervention */
.intervention-zone-container {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
}

.intervention-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
    background: var(--bg-secondary);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid var(--border-light);

    .form-control, select.form-control {
        margin-bottom: 0 !important;
        width: 100%;
        padding: 10px 15px;
        border: 2px solid var(--border-light) !important;
        border-radius: 8px !important;
        font-size: 1rem;
        background: var(--white) !important;
        color: var(--text-primary);
        box-sizing: border-box;
        height: 45px;
        appearance: auto; /* Restore default arrow for select */
        transition: all 0.3s ease;

        &:focus {
            outline: none;
            border-color: var(--primary-color) !important;
            box-shadow: 0 0 0 3px var(--primary-focus);
        }

        &:hover {
            border-color: var(--border-medium) !important;
        }
    }

    .btn {
        padding: 0 20px;
        font-size: 0.9rem;
        height: 45px;
        display: flex;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
        border-radius: 8px;
        margin: 0 !important;
    }
}

.input-with-btn {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.zips-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    padding: 20px;
    background: #fff;
    border: 2px dashed var(--border-light);
    border-radius: 12px;
    min-height: 100px;
}

.zip-tag {
    background: var(--primary-light);
    color: var(--primary-color);
    padding: 6px 14px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid var(--primary-focus);
    transition: all 0.2s ease;
    position: relative; /* For tooltip */
    cursor: help;
}

/* Tooltip style */
.zip-tag::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.zip-tag:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.zip-tag:hover {
    background: var(--primary-color);
    color: #fff;
}

.zip-tag .remove-zip {
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    opacity: 0.7;
    background: none;
    border: none;
    color: inherit;
    padding: 0;
    margin-left: 5px;
}

.zip-tag .remove-zip:hover {
    opacity: 1;
}

.selected-zones-wrapper {
    margin-bottom: 30px;
}

.selected-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    margin-bottom: 10px;
}

.selected-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.btn-link {
    background: none;
    border: none;
    color: var(--danger-color);
    text-decoration: underline;
    cursor: pointer;
    font-weight: 500;
    padding: 0;
}

.btn-link:hover {
    color: var(--danger-hover);
}

.intervention-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);

    .btn {
        height: 45px;
        padding: 0 25px;
        display: flex;
        align-items: center;
        gap: 10px;
        border-radius: 8px;
        font-weight: 600;
    }
}

@media (max-width: 768px) {
    .intervention-controls {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

    .certifications-header {
        margin-bottom: 32px;

        h2 {
            color: var(--primary-color);
            font-size: 26px;
            font-weight: 700;
            margin-bottom: 12px;
            margin-top: 0;
        }

        p {
            color: #979797;
            font-size: 16px;
            line-height: 1.5;
            margin: 0;
        }
    }

    .certifications-form {
        .certifications-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 20px;
            margin-bottom: 32px;

            @media (min-width: 768px) {
                grid-template-columns: repeat(2, 1fr);
            }

            @media (min-width: 1024px) {
                grid-template-columns: repeat(3, 1fr);
            }

            @media (min-width: 1200px) {
                grid-template-columns: repeat(4, 1fr);
            }
        }

        .certification-item {
            display: flex;
            align-items: flex-start;
            gap: 16px;
            padding: 20px;
            border: 2px solid var(--border-light);
            border-radius: 12px;
            transition: all 0.3s ease;
            background: var(--white);

            &:hover {
                border-color: var(--primary-color);
                box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
                transform: translateY(-2px);
            }

            &.selected {
                border-color: var(--primary-color);
                background: var(--primary-light);
            }

            .certification-checkbox {
                position: relative;
                margin-top: 8px;
                flex-shrink: 0;

                input[type="checkbox"] {
                    width: 20px;
                    height: 20px;
                    margin: 0;
                    cursor: pointer;
                    opacity: 0;
                    position: absolute;

                    &:checked + label {
                        background: var(--primary-color);
                        border-color: var(--primary-color);

                        &::after {
                            opacity: 1;
                            transform: scale(1);
                        }
                    }
                }

                label {
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    width: 20px;
                    height: 20px;
                    border: 2px solid var(--border-medium);
                    border-radius: 4px;
                    background: var(--white);
                    cursor: pointer;
                    position: relative;
                    transition: all 0.3s ease;

                    &::after {
                        content: '✓';
                        color: var(--white);
                        font-size: 12px;
                        font-weight: bold;
                        opacity: 0;
                        transform: scale(0);
                        transition: all 0.2s ease;
                    }
                }
            }

            .certification-content {
                flex: 1;
                display: flex;
                flex-direction: column;
                gap: 12px;

                .certification-logo {
                    align-self: flex-start;

                    .certification-image {
                        width: 60px;
                        height: 60px;
                        object-fit: contain;
                        border-radius: 8px;
                        background: var(--white);
                        padding: 8px;
                        box-shadow: var(--shadow-sm);
                    }
                }

                .certification-details {
                    .certification-name {
                        margin: 0 0 12px 0;
                        color: var(--text-primary);
                        font-size: 16px;
                        font-weight: 600;
                        line-height: 1.3;
                    }

                    .certification-number-field {
                        label {
                            display: block;
                            margin-bottom: 8px;
                            color: var(--text-primary);
                            font-weight: 500;
                            font-size: 14px;
                        }

                        input[type="text"] {
                            width: 100%;
                            padding: 10px 12px;
                            border: 1px solid var(--border-medium);
                            border-radius: 6px;
                            font-size: 14px;
                            background: var(--white);
                            color: var(--text-primary);
                            transition: all 0.3s ease;

                            &:focus {
                                outline: none;
                                border-color: var(--primary-color);
                                box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
                            }

                            &::placeholder {
                                color: var(--text-muted);
                            }
                        }
                    }
                }
            }
        }

    }

    /* Section Banques */
    .banks-section {
        padding: 40px 0;
    }

    .banks-header {
        margin-bottom: 32px;
        p {
            color: #979797;
            font-size: 16px;
            line-height: 1.5;
            margin: 0;
        }
    }

    .banks-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 20px;
        margin-bottom: 32px;

        @media (min-width: 768px) { grid-template-columns: repeat(2, 1fr); }
        @media (min-width: 1024px) { grid-template-columns: repeat(3, 1fr); }
        @media (min-width: 1200px) { grid-template-columns: repeat(4, 1fr); }
    }

    .bank-item {
        display: flex;
        align-items: flex-start;
        gap: 16px;
        padding: 20px;
        border: 2px solid var(--border-light);
        border-radius: 12px;
        transition: all 0.3s ease;
        background: var(--white);
        cursor: pointer;

        &:hover {
            border-color: var(--primary-color);
            box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
            transform: translateY(-2px);
        }

        &.selected {
            border-color: var(--primary-color);
            background: var(--primary-light);
        }

        .bank-checkbox {
            position: relative;
            margin-top: 8px;
            flex-shrink: 0;

            input[type="checkbox"] {
                width: 20px;
                height: 20px;
                margin: 0;
                cursor: pointer;
                opacity: 0;
                position: absolute;

                &:checked + label {
                    background: var(--primary-color);
                    border-color: var(--primary-color);
                    &::after {
                        opacity: 1;
                        transform: scale(1);
                    }
                }
            }

            label {
                display: flex;
                align-items: center;
                justify-content: center;
                width: 20px;
                height: 20px;
                border: 2px solid var(--border-medium);
                border-radius: 4px;
                background: var(--white);
                cursor: pointer;
                position: relative;
                transition: all 0.3s ease;

                &::after {
                    content: '✓';
                    color: var(--white);
                    font-size: 12px;
                    font-weight: bold;
                    opacity: 0;
                    transform: scale(0);
                    transition: all 0.2s ease;
                }
            }
        }

        .bank-content {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 12px;

            .bank-logo {
                align-self: flex-start;
                .bank-image {
                    width: 60px;
                    height: 60px;
                    object-fit: contain;
                    border-radius: 8px;
                    background: var(--white);
                    padding: 8px;
                    box-shadow: var(--shadow-sm);
                }
            }

            .bank-details {
                .bank-name {
                    margin: 0;
                    color: var(--text-primary);
                    font-size: 16px;
                    font-weight: 600;
                    line-height: 1.3;
                }
            }
        }
    }

    /* Responsive Design */
    @media (max-width: 900px) {
        .user-profile-header {
            flex-direction: column;
            margin-top:0;
            gap: 20px;
            align-items: stretch;

            h1 {
                font-size: 24px;
            }
        }

        .personal-info-section {
            .personal-info-content {
                flex-direction: column;
                gap: 20px;

                .personal-info-info {
                    width: 100%;

                    h3 {
                        font-size: 20px;
                    }

                    p {
                        font-size: 14px;
                    }
                }

                .personal-info-form {
                    width: 100%;
                }
            }
        }

        .signature-section {
            .signature-content {
                flex-direction: column;
                gap: 20px;

                .signature-info {
                    width: 100%;

                    h3 {
                        font-size: 20px;
                    }

                    p {
                        font-size: 14px;
                    }
                }

                .signature-preview {
                    width: 100%;
                    height: 120px;

                    .edit-signature-btn {
                        font-size: 0.75rem;
                        padding: 8px 16px;
                    }
                }
            }
        }

        .certifications-section {
            .certifications-header {
                h2 {
                    font-size: 22px;
                }

                p {
                    font-size: 14px;
                }
            }

            .certifications-form {
                .certifications-grid {
                    grid-template-columns: 1fr;
                    gap: 16px;
                }

                .certification-item {
                    .certification-content {
                        .certification-logo {
                            .certification-image {
                                width: 50px;
                                height: 50px;
                            }
                        }
                    }
                }
            }
        }
    }

    @media (max-width: 750px) {
        padding: 15px;
        padding-bottom: 100px;
    }
}

/* Animation pour les champs modifiés */
.form-group input.modified {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.form-group input.saved {
    border-color: var(--success-color);
    background: var(--success-light);
}

/* Effet de focus amélioré */
.form-group input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--white);
    box-shadow: 0 0 0 3px var(--primary-focus);
    transform: translateY(-1px);
}


