/* Projects Filter System CSS */

/* ===========================================
   PROJECT TABS
   =========================================== */

.project-tabs {
    margin-bottom: 30px;
}

.tabs-header {
    border-bottom: 2px solid #e5e5e5;
}

.tabs-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
}

.tab-item {
    position: relative;
}

.tab-item.active .tab-link {
    color: #ff6b35;
    border-bottom: 3px solid #ff6b35;
}

.tab-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px 20px;
    color: #666;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.tab-link:hover {
    color: #ff6b35;
    background-color: #f8f9fa;
}

.tab-count {
    background-color: #e9ecef;
    color: #6c757d;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

/* ===========================================
   FILTERS BAR
   =========================================== */

.filters-bar {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 40px;
    padding: 25px;
    border: 1px solid #e9ecef;
}

.filters-container {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
}

/* Search Group */
.search-group {
    flex: 1;
    min-width: 250px;
}

.search-input-wrapper {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 12px 45px 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #fff;
}

.search-input:focus {
    outline: none;
    border-color: #ff6b35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 16px;
}

/* Dropdown Group */
.dropdown-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.dropdown-wrapper {
    position: relative;
    min-width: 160px;
}

.filter-dropdown {
    width: 100%;
    padding: 12px 35px 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
}

.filter-dropdown:focus {
    outline: none;
    border-color: #ff6b35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.dropdown-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 12px;
    pointer-events: none;
}

/* Filter Separator */
.filter-separator {
    width: 1px;
    height: 40px;
    background-color: #e9ecef;
    margin: 0 10px;
}

/* Sort Group */
.sort-group .sort-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.sort-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    color: #6c757d;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sort-btn:hover {
    background: #e9ecef;
    border-color: #dee2e6;
}

.sort-btn.active {
    background: #ff6b35;
    border-color: #ff6b35;
    color: #fff;
}

.sort-btn.active:hover {
    background: #e55a2b;
    border-color: #e55a2b;
}

.sort-label {
    font-weight: 500;
}

/* ===========================================
   REORDER CONTROLS
   =========================================== */

.reorder-toggle-btn {
    background: #6c757d !important;
    color: #fff !important;
    border-color: #6c757d !important;
}

.reorder-toggle-btn:hover {
    background: #5a6268 !important;
    border-color: #5a6268 !important;
}

.reorder-toggle-btn.active {
    background: #ff6b35 !important;
    border-color: #ff6b35 !important;
}

.reorder-toggle-btn.active:hover {
    background: #e55a2b !important;
    border-color: #e55a2b !important;
}

.reorder-actions {
    display: flex;
    gap: 8px;
    margin-left: 12px;
}

.save-order-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #28a745;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.save-order-btn:hover {
    background: #218838;
}

.cancel-reorder-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.cancel-reorder-btn:hover {
    background: #c82333;
}

/* Drag and drop styles */
.reorder-mode .project-card {
    cursor: grab;
    transition: all 0.2s ease;
}

.reorder-mode .project-card:active {
    cursor: grabbing;
}

.reorder-mode .project-card:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.reorder-mode .project-card.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.reorder-placeholder {
    background: #e9ecef;
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    height: 200px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-weight: 500;
}

.reorder-mode .project-overlay {
    display: none;
}

.reorder-mode .reorder-handle {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 16px;
    cursor: grab;
    z-index: 10;
}

.reorder-mode .reorder-handle:active {
    cursor: grabbing;
}

/* ===========================================
   PROJECTS GRID
   =========================================== */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.project-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

/* Project Image */
.project-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

.no-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
}

.no-image i {
    margin-bottom: 10px;
    opacity: 0.8;
}

/* Image Counter */
.image-counter {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 107, 53, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
}

.image-counter i {
    font-size: 11px;
}

/* Project Overlay */
.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.project-card:hover .project-overlay {
    opacity: 1;
}


.view-btn:hover {
    color: #ff6b35;
}

.info-btn:hover {
    color: #28a745;
}

/* Project Content */
.project-content {
    padding: 20px;
}

.project-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    line-height: 1.4;
}

.project-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
    color: #6c757d;
    gap: 15px;
}

.project-client,
.project-year,
.project-type {
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.project-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-termine {
    background: #d4edda;
    color: #155724;
}

.status-en_cours {
    background: #fff3cd;
    color: #856404;
}

.status-en_pause {
    background: #f8d7da;
    color: #721c24;
}

.project-technologies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.tech-tag {
    background: #e9ecef;
    color: #495057;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

/* ===========================================
   LOADING AND NO RESULTS
   =========================================== */

.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #6c757d;
}

.spinner {
    display: flex;
    gap: 4px;
    margin-bottom: 15px;
}

.spinner div {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #ff6b35;
    animation: bounce 1.4s ease-in-out infinite both;
}

.spinner .bounce1 { animation-delay: -0.32s; }
.spinner .bounce2 { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.no-results {
    text-align: center;
    padding: 80px 20px;
    color: #6c757d;
}

.no-results-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-results h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #495057;
}

.no-results p {
    font-size: 16px;
    margin: 0;
}

/* ===========================================
   RESPONSIVE DESIGN
   =========================================== */

@media (max-width: 1200px) {
    .filters-container {
        gap: 15px;
    }

    .dropdown-group {
        gap: 10px;
    }

    .dropdown-wrapper {
        min-width: 140px;
    }

    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 25px;
    }
}

@media (max-width: 992px) {
    .filters-bar {
        padding: 20px;
    }

    .filters-container {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }

    .search-group {
        min-width: auto;
        order: -1;
    }

    .dropdown-group {
        justify-content: center;
        flex-wrap: wrap;
    }

    .dropdown-wrapper {
        min-width: 160px;
        flex: 1;
        min-width: 140px;
    }

    .filter-separator {
        display: none;
    }

    .sort-group {
        justify-content: center;
    }

    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }

    .tabs-list {
        flex-wrap: wrap;
    }

    .tab-link {
        padding: 12px 16px;
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .project-tabs {
        margin-bottom: 20px;
    }

    .filters-bar {
        padding: 15px;
        margin-bottom: 30px;
    }

    .dropdown-group {
        flex-direction: column;
        gap: 12px;
    }

    .dropdown-wrapper {
        min-width: auto;
        width: 100%;
    }

    .sort-buttons {
        width: 100%;
        justify-content: center;
    }

    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }

    .project-content {
        padding: 15px;
    }

    .project-title {
        font-size: 16px;
    }

    .project-meta {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
}

@media (max-width: 576px) {
    .tabs-list {
        justify-content: center;
    }

    .tab-link {
        padding: 10px 12px;
        font-size: 13px;
    }

    .tab-count {
        font-size: 12px;
        padding: 1px 6px;
    }

    .filters-bar {
        padding: 12px;
    }

    .search-input {
        font-size: 14px;
        padding: 10px 35px 10px 12px;
    }

    .filter-dropdown {
        font-size: 14px;
        padding: 10px 30px 10px 12px;
    }

    .sort-btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .project-card {
        margin: 0 10px;
    }

    .project-image {
        height: 180px;
    }

    .project-title {
        font-size: 15px;
    }

    .tech-tag {
        font-size: 10px;
        padding: 3px 6px;
    }
}

/* ===========================================
   ANIMATIONS AND TRANSITIONS
   =========================================== */

.project-card {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.project-card:nth-child(1) { animation-delay: 0.1s; }
.project-card:nth-child(2) { animation-delay: 0.2s; }
.project-card:nth-child(3) { animation-delay: 0.3s; }
.project-card:nth-child(4) { animation-delay: 0.4s; }
.project-card:nth-child(5) { animation-delay: 0.5s; }
.project-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Smooth transitions for filter changes */
.projects-grid {
    transition: opacity 0.3s ease;
}

/* ===========================================
   ACCESSIBILITY
   =========================================== */

.tab-link:focus,
.filter-dropdown:focus,
.sort-btn:focus,
.search-input:focus,
.reorder-toggle-btn:focus,
.save-order-btn:focus,
.cancel-reorder-btn:focus {
    outline: 2px solid #ff6b35;
    outline-offset: 2px;
}

.action-btn:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===========================================
   PROJECT GALLERY (CLASSIC STYLE)
   =========================================== */

.project-gallery-section {
    margin-top: 40px;
    margin-bottom: 30px;
}

.project-gallery-section h3 {
    color: #333;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 25px;
    text-align: center;
    position: relative;
}

.project-gallery-section h3::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, #ff6b35, #ff8c42);
    border-radius: 2px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: #fff;
}

.gallery-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.gallery-link {
    display: block;
    position: relative;
    text-decoration: none;
    overflow: hidden;
}

.gallery-item img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.9), rgba(255, 140, 66, 0.9));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.zoom-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.gallery-item:hover .zoom-icon {
    transform: scale(1);
}

.zoom-icon i {
    font-size: 24px;
    color: #ff6b35;
}

/* Fancybox Customizations */
.fancybox-button {
    background: rgba(0,0,0,0.8) !important;
}

.fancybox-button:hover {
    background: rgba(255, 107, 53, 0.9) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 15px;
    }

    .gallery-item img {
        height: 180px;
    }

    .zoom-icon {
        width: 50px;
        height: 50px;
    }

    .zoom-icon i {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 12px;
    }

    .gallery-item img {
        height: 150px;
    }

    .project-gallery-section h3 {
        font-size: 20px;
    }
}