/* Artisans Management Styles */

/* Override icon sizes for artisans page */
.section-title .section-icon {
    width: 24px !important;
    height: 24px !important;
    flex-shrink: 0 !important;
}

.btn .btn-icon {
    width: 18px !important;
    height: 18px !important;
    flex-shrink: 0 !important;
}

.nav-link .nav-icon {
    width: 20px !important;
    height: 20px !important;
    flex-shrink: 0 !important;
}

.logout-btn .nav-icon {
    width: 20px !important;
    height: 20px !important;
    flex-shrink: 0 !important;
}

.search-icon {
    width: 20px !important;
    height: 20px !important;
    flex-shrink: 0 !important;
}

/* Search and Filters Section */
.search-filters-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e5e5;
    padding: 24px;
    margin-bottom: 24px;
}

.search-container {
    margin-bottom: 20px;
}

.search-input-wrapper {
    position: relative;
    max-width: 600px;
}

.search-input-wrapper .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #2c3e50;
    box-shadow: 0 0 0 2px rgba(44, 62, 80, 0.1);
}

/* Filters */
.filters-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.filter-label {
    color: #6c757d;
    font-size: 14px;
    font-weight: 600;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-btn {
    background: white;
    border: 1px solid #e5e5e5;
    color: #495057;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: #2c3e50;
    background: #f8f9fa;
}

.filter-btn.active {
    background: #2c3e50;
    color: white;
    border-color: #2c3e50;
}

/* Artisans Section */
.artisans-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e5e5;
    overflow: hidden;
}

/* Artisans Table */
.table-container {
    overflow-x: auto;
    width: 100%;
}

.artisans-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.artisans-table th {
    background: #f8f9fa;
    color: #2c3e50;
    font-weight: 600;
    font-size: 14px;
    padding: 16px 12px;
    text-align: left;
    border-bottom: 1px solid #e5e5e5;
    white-space: nowrap;
}

.artisans-table td {
    padding: 16px 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    color: #495057;
    vertical-align: middle;
}

.artisans-table tbody tr:hover {
    background: #f8f9fa;
}

.artisans-table tbody tr:last-child td {
    border-bottom: none;
}

/* Artisan Info */
.artisan-name-cell {
    font-weight: 600;
    color: #2c3e50;
}

.artisan-company {
    color: #6c757d;
    font-size: 12px;
    display: block;
    margin-top: 4px;
}

/* Contact Info */
.contact-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

/* Qualifications Display */
.qualifications-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.qualification-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #e3f2fd;
    color: #1976d2;
}

.qualification-badge.masonry {
    background: #e3f2fd;
    color: #1976d2;
}

.qualification-badge.electricity {
    background: #fff3e0;
    color: #f57c00;
}

.qualification-badge.plumbing {
    background: #e8f5e8;
    color: #2e7d32;
}

.qualification-badge.finishing {
    background: #f3e5f5;
    color: #7b1fa2;
}

.qualification-badge.roofing {
    background: #ffebee;
    color: #d32f2f;
}

.qualification-badge.carpentry {
    background: #fff8e1;
    color: #f9a825;
}

/* Sites Count */
.sites-count {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #2c3e50;
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 14px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 8px;
}

.action-btn {
    background: #2c3e50;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.action-btn:hover {
    background: #34495e;
}

.action-btn.secondary {
    background: #6c757d;
}

.action-btn.secondary:hover {
    background: #5a6268;
}

.action-btn.danger {
    background: #dc3545;
}

.action-btn.danger:hover {
    background: #c82333;
}

/* Modal Enhancements */
.modal-large {
    max-width: 800px;
}

.modal-form {
    padding: 24px;
}

.form-section {
    margin-bottom: 32px;
}

.form-section:last-child {
    margin-bottom: 0;
}

.form-section-title {
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f8f9fa;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    color: #495057;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}

.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    font-family: inherit;
    background: white;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    outline: none;
    border-color: #2c3e50;
    box-shadow: 0 0 0 2px rgba(44, 62, 80, 0.1);
}

.input-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Qualifications Grid */
.qualifications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.qualification-checkbox {
    position: relative;
    cursor: pointer;
    user-select: none;
}

.qualification-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.qualification-checkbox .qualification-badge {
    display: flex;
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    opacity: 0.5;
}

.qualification-checkbox input[type="checkbox"]:checked+.qualification-badge {
    opacity: 1;
    border-color: currentColor;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.qualification-checkbox:hover .qualification-badge {
    opacity: 0.8;
    transform: translateY(-2px);
}

/* Delete Modal */
.warning-message {
    text-align: center;
    padding: 20px;
}

.warning-icon {
    color: #ffc107;
    margin-bottom: 16px;
}

.warning-message p {
    color: #495057;
    font-size: 16px;
    margin: 8px 0;
}

.warning-detail {
    color: #dc3545;
    font-weight: 600;
    font-size: 14px;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

/* Detail Page Styles */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.detail-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e5e5;
    padding: 24px;
}

.detail-card .section-title {
    margin-bottom: 20px;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.info-label {
    color: #6c757d;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    color: #2c3e50;
    font-size: 14px;
    font-weight: 600;
}

.qualifications-display {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.qualifications-display .qualification-badge {
    font-size: 13px;
    padding: 8px 16px;
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.qualification-badge.checked {
    background: #e3f2fd;
    color: #1976d2;
    border: none;
}

.qualification-badge.unchecked {
    background: white;
    color: #495057;
    border: 1px solid #e5e5e5;
}

.qualification-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.qualification-badge.unchecked:hover {
    border-color: #2c3e50;
    background: #f8f9fa;
}

.qualification-badge.checked:hover {
    background: #bbdefb;
}

.editable-item {
    position: relative;
}

.editable {
    outline: none;
    padding: 2px 4px;
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

.editable:hover {
    background-color: #f0f0f0;
}

.editable:focus {
    background-color: #fff;
    box-shadow: 0 0 0 2px rgba(44, 62, 80, 0.2);
}

/* Detail Section */
.detail-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e5e5;
    padding: 24px;
    margin-bottom: 24px;
}

.detail-section .section-title {
    margin-bottom: 20px;
}

.count-badge {
    background: #2c3e50;
    color: white;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    margin-left: 8px;
    font-weight: 600;
}

/* Sites List */
.sites-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.site-item {
    background: #f8f9fa;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.site-item:hover {
    border-color: #2c3e50;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.1);
}

.site-item-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.site-item-chantier {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.site-item-title {
    color: #2c3e50;
    font-size: 15px;
    font-weight: 600;
}

.site-item-detail {
    color: #6c757d;
    font-size: 13px;
    line-height: 1.6;
}

.dropdown-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2c3e50;
    transition: transform 0.3s ease, color 0.3s ease, background-color 0.3s ease;
    border-radius: 4px;
    flex-shrink: 0;
}

.dropdown-toggle:hover {
    background: #e9ecef;
    color: #495057;
}

.dropdown-toggle[aria-expanded="true"] .dropdown-icon {
    transform: rotate(180deg);
}

.dropdown-icon {
    transition: transform 0.3s ease;
}

.etapes-dropdown {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e5e5;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }

    to {
        opacity: 1;
        max-height: 500px;
    }
}

.etapes-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.etape-item {
    padding: 10px 12px;
    background: #f8f9fa;
    border-left: 3px solid #2c3e50;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.etape-name {
    color: #2c3e50;
    font-weight: 600;
    font-size: 14px;
}

.etape-dates {
    display: flex;
    gap: 16px;
    font-size: 12px;
    align-items: center;
}

.etape-date {
    color: #6c757d;
}

.etape-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.etape-status-en-cours {
    background: #d1ecf1;
    color: #0c5460;
}

.site-item-steps {
    color: #495057;
    font-size: 13px;
}

/* History Table */
.history-table {
    width: 100%;
    border-collapse: collapse;
}

.history-table th {
    background: #f8f9fa;
    color: #2c3e50;
    font-weight: 600;
    font-size: 14px;
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e5e5;
}

.history-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    color: #495057;
}

.history-table tbody tr:hover {
    background: #f8f9fa;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.completed {
    background: #d4edda;
    color: #155724;
}

/* Notes List */
.notes-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.note-item {
    background: #f8f9fa;
    border-left: 4px solid #2c3e50;
    border-radius: 6px;
    padding: 16px;
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.note-author {
    color: #2c3e50;
    font-weight: 600;
    font-size: 14px;
}

.note-date {
    color: #6c757d;
    font-size: 12px;
}

.note-content {
    color: #495057;
    font-size: 14px;
    line-height: 1.6;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    opacity: 0.3;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 968px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .qualifications-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .filters-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .action-buttons {
        flex-direction: column;
        width: 100%;
    }

    .action-btn {
        width: 100%;
    }

    .section-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .modal-large {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .search-filters-section {
        padding: 16px;
    }

    .detail-card,
    .detail-section {
        padding: 16px;
    }
}

/* Animation */
.artisans-table tbody tr,
.site-item,
.note-item {
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}