/**
 * Project Gallery Styles - Alukraft Theme
 *
 * Contains all styles for the project reference gallery including:
 * - Hero section
 * - Sidebar with category/product filters
 * - Project cards grid
 * - Project detail modal
 * - Dark mode support
 */

/* ==========================================================================
   HERO SECTION
   ========================================================================== */

.gallery-hero {
    color: white;
}

/* ==========================================================================
   SIDEBAR - Category & Product Filters
   ========================================================================== */

.gallery-sidebar {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 1rem;
}

.category-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.category-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 2px solid transparent;
    border-radius: 6px;
    background: #f8f9fa;
    color: #333;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    width: 100%;
}

.category-btn:hover {
    background: #fff;
    border-color: #ee780e;
    transform: translateX(5px);
}

.category-btn.active {
    background: #ee780e;
    color: white;
    border-color: #ee780e;
}

.category-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.category-icon img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.category-name {
    flex: 1;
}

.category-count {
    background: rgba(0, 0, 0, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
}

.category-btn.active .category-count {
    background: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   GALLERY HEADER - Title & Controls
   ========================================================================== */

.gallery-header {
    margin-bottom: 2rem;
}

.gallery-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #333;
}

.gallery-controls .form-select {
    border: 2px solid #ddd;
    border-radius: 6px;
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    font-weight: 500;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
}

.gallery-controls .form-select:focus {
    border-color: #ee780e;
    box-shadow: 0 0 0 0.2rem rgba(238, 120, 14, 0.25);
}

/* ==========================================================================
   PROJECT CARDS - Grid Display
   ========================================================================== */

.project-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

.project-image {
    position: relative;
    height: 250px;
    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.1);
}

.project-overlay {
    position: absolute;
    inset: 0;
    background: rgba(238, 120, 14, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.view-project-btn {
    background: white;
    color: #ee780e;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.view-project-btn:hover {
    background: #5d6d77;
    color: white;
    transform: scale(1.05);
}

.project-info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-category {
    display: inline-block;
    background: #ee780e;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
    align-self: flex-start;
}

.project-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.75rem;
}

.project-description {
    color: #666;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    flex: 1;
}

.project-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: #999;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.project-location,
.project-year {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* ==========================================================================
   PROJECT MODAL - Detail View
   ========================================================================== */

.project-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.project-modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.25rem;
    color: #333;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 2;
}

.modal-close:hover {
    background: #ee780e;
    color: white;
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
}

/* Modal Gallery - Image Slider
   -------------------------------------------------------------------------- */

.modal-gallery {
    margin-bottom: 2rem;
}

.modal-gallery-main {
    position: relative;
    margin-bottom: 1rem;
}

.modal-image-main {
    width: 100%;
    height: 500px;
    object-fit: contain;
    background: #f8f9fa;
    border-radius: 8px;
}

.modal-gallery-nav {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.7);
    padding: 0.5rem 1rem;
    border-radius: 50px;
}

.gallery-nav-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: all 0.3s ease;
}

.gallery-nav-btn:hover {
    color: #ee780e;
    transform: scale(1.2);
}

.gallery-counter {
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    min-width: 60px;
    text-align: center;
}

.modal-gallery-thumbs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem 0;
}

.modal-gallery-thumbs .thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.modal-gallery-thumbs .thumb:hover {
    border-color: #ee780e;
    transform: scale(1.05);
}

.modal-gallery-thumbs .thumb.active {
    border-color: #ee780e;
}

.modal-info {
    margin-top: 2rem;
}

.modal-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.modal-title {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 1rem;
}

.modal-meta {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #eee;
}

.modal-meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.modal-meta-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #999;
    font-weight: 600;
}

.modal-meta-value {
    font-size: 1rem;
    color: #333;
    font-weight: 600;
}

.modal-description {
    color: #666;
    line-height: 1.8;
    font-size: 1rem;
    margin-bottom: 2rem;
}

.modal-specs {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.modal-specs h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 1rem;
}

.modal-specs ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.modal-specs li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
}

.modal-specs li:last-child {
    border-bottom: none;
}

.modal-specs .spec-label {
    font-weight: 600;
    color: #666;
}

.modal-specs .spec-value {
    color: #333;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

.project-card {
    animation: fadeIn 0.5s ease;
}

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

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */

/* Tablet & Mobile (max-width: 991px)
   -------------------------------------------------------------------------- */

@media (max-width: 991px) {
    .gallery-sidebar {
        position: static !important;
        margin-bottom: 2rem;
    }

    .category-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .category-btn {
        flex: 1;
        min-width: 150px;
    }
}

/* Mobile Small (max-width: 575px)
   -------------------------------------------------------------------------- */

@media (max-width: 575px) {
    .project-image {
        height: 200px;
    }

    .modal-image {
        height: 250px;
    }

    .modal-title {
        font-size: 1.5rem;
    }

    .modal-meta {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Product Navigation - Filter by Used Products
   -------------------------------------------------------------------------- */

.product-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.product-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 2px solid transparent;
    border-radius: 6px;
    background: #f8f9fa;
    color: #333;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    width: 100%;
}

.product-btn:hover {
    background: #fff;
    border-color: #ee780e;
    transform: translateX(5px);
}

.product-btn.active {
    background: #ee780e;
    color: white;
    border-color: #ee780e;
}

.product-btn .product-badge {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.product-btn .product-name {
    flex: 1;
    font-size: 0.875rem;
}

.product-btn .product-count {
    background: rgba(0, 0, 0, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
}

.product-btn.active .product-count {
    background: rgba(255, 255, 255, 0.2);
}

/* Product Badges - Displayed on Project Cards
   -------------------------------------------------------------------------- */

.project-products {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.product-badge-small {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-badge-small.more {
    background: #95a5a6;
}

/* Sidebar Sticky & Scrollbar - Desktop Only
   -------------------------------------------------------------------------- */

@media (min-width: 992px) {
    .gallery-sidebar {
        max-height: calc(100vh - 100px);
        overflow-y: auto;
        padding-right: 0.5rem;
    }

    .gallery-sidebar::-webkit-scrollbar {
        width: 6px;
    }

    .gallery-sidebar::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 10px;
    }

    .gallery-sidebar::-webkit-scrollbar-thumb {
        background: #ee780e;
        border-radius: 10px;
    }

    .gallery-sidebar::-webkit-scrollbar-thumb:hover {
        background: #d66e0c;
    }
}

/* ==========================================================================
   DARK MODE STYLES
   ========================================================================== */

/* Background Transparency - Prevent white boxes in dark mode
   -------------------------------------------------------------------------- */
body[style*="background-color: rgb(40, 49, 68)"] .body-inner,
body[style*="background-color: rgb(40, 49, 68)"] .gallery-main,
body[style*="background-color: rgb(40, 49, 68)"] section.gallery-main,
body[style*="background-color: rgb(40, 49, 68)"] .container,
body[style*="background-color: rgb(40, 49, 68)"] .container-fluid,
body[style*="background-color: rgb(40, 49, 68)"] .row {
    background-color: transparent !important;
}

/* Hero Section - Transparent Background
   -------------------------------------------------------------------------- */

body[style*="background-color: rgb(40, 49, 68)"] .gallery-hero .container,
body[style*="background-color: rgb(40, 49, 68)"] .gallery-hero .row,
body[style*="background-color: rgb(40, 49, 68)"] .gallery-hero .col-12,
body[style*="background-color: rgb(40, 49, 68)"] .gallery-hero .darkModeDiv {
    background-color: transparent !important;
}

/* Sidebar - Dark Mode Styles
   -------------------------------------------------------------------------- */

body[style*="background-color: rgb(40, 49, 68)"] .gallery-sidebar {
    background: #1e2835 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5) !important;
}

body[style*="background-color: rgb(40, 49, 68)"] .gallery-sidebar .sidebar-title,
body[style*="background-color: rgb(40, 49, 68)"] .sidebar-title {
    color: #ffffff !important;
}

/* Category Buttons - Dark Mode Styles
   -------------------------------------------------------------------------- */

body[style*="background-color: rgb(40, 49, 68)"] .category-btn {
    background: #151a24 !important;
    color: #ffffff !important;
    border-color: #3E4B67 !important;
}

body[style*="background-color: rgb(40, 49, 68)"] .category-btn:hover {
    background: #1e2835 !important;
    border-color: #ee780e !important;
    transform: translateX(5px);
}

body[style*="background-color: rgb(40, 49, 68)"] .category-btn.active {
    background: #ee780e !important;
    color: white !important;
    border-color: #ee780e !important;
}

body[style*="background-color: rgb(40, 49, 68)"] .category-btn .category-name {
    color: inherit !important;
}

body[style*="background-color: rgb(40, 49, 68)"] .category-btn .category-count {
    background: rgba(255, 255, 255, 0.1) !important;
}

body[style*="background-color: rgb(40, 49, 68)"] .category-btn.active .category-count {
    background: rgba(255, 255, 255, 0.2) !important;
}

/* Product Buttons - Dark Mode Styles
   -------------------------------------------------------------------------- */

body[style*="background-color: rgb(40, 49, 68)"] .product-btn {
    background: #151a24 !important;
    color: #ffffff !important;
    border-color: #3E4B67 !important;
}

body[style*="background-color: rgb(40, 49, 68)"] .product-btn:hover {
    background: #1e2835 !important;
    border-color: #ee780e !important;
    transform: translateX(5px);
}

body[style*="background-color: rgb(40, 49, 68)"] .product-btn.active {
    background: #ee780e !important;
    color: white !important;
    border-color: #ee780e !important;
}

body[style*="background-color: rgb(40, 49, 68)"] .product-btn .product-name {
    color: inherit !important;
}

body[style*="background-color: rgb(40, 49, 68)"] .product-btn .product-count {
    background: rgba(255, 255, 255, 0.1) !important;
}

body[style*="background-color: rgb(40, 49, 68)"] .product-btn.active .product-count {
    background: rgba(255, 255, 255, 0.2) !important;
}

/* Gallery Title - Dark Mode Styles
   -------------------------------------------------------------------------- */

body[style*="background-color: rgb(40, 49, 68)"] .gallery-title,
body[style*="background-color: rgb(40, 49, 68)"] h2.gallery-title {
    color: #ffffff !important;
}

/* Project Cards - Dark Mode Styles
   -------------------------------------------------------------------------- */

body[style*="background-color: rgb(40, 49, 68)"] .project-card {
    background: #151a2300 !important;
    border: 1px solid #3E4B67 !important;
}

body[style*="background-color: rgb(40, 49, 68)"] .project-card:hover {
    border-color: #ee780e !important;
    box-shadow: 0 10px 30px rgba(238, 120, 14, 0.2) !important;
}

body[style*="background-color: rgb(40, 49, 68)"] .project-card .project-title,
body[style*="background-color: rgb(40, 49, 68)"] .project-title,
body[style*="background-color: rgb(40, 49, 68)"] h3.project-title {
    color: #ffffff !important;
}

body[style*="background-color: rgb(40, 49, 68)"] .project-card .project-description,
body[style*="background-color: rgb(40, 49, 68)"] .project-description {
    color: #b8bbc1 !important;
}

body[style*="background-color: rgb(40, 49, 68)"] .project-card .project-meta {
    border-top-color: #3E4B67 !important;
    color: #b8bbc1 !important;
}

body[style*="background-color: rgb(40, 49, 68)"] .project-card .project-year,
body[style*="background-color: rgb(40, 49, 68)"] .project-year {
    color: #b8bbc1 !important;
}

body[style*="background-color: rgb(40, 49, 68)"] .project-card .project-category {
    background: #ee780e !important;
    color: white !important;
}

/* Modal - Dark Mode Styles
   -------------------------------------------------------------------------- */

body[style*="background-color: rgb(40, 49, 68)"] .modal-content {
    background: #1e2835 !important;
}

body[style*="background-color: rgb(40, 49, 68)"] .modal-content .modal-close {
    background: #151a24 !important;
    color: #ffffff !important;
}

body[style*="background-color: rgb(40, 49, 68)"] .modal-content .modal-close:hover {
    background: #ee780e !important;
    color: white !important;
}

body[style*="background-color: rgb(40, 49, 68)"] .modal-content .modal-title {
    color: #ffffff !important;
}

body[style*="background-color: rgb(40, 49, 68)"] .modal-content .modal-meta-value {
    color: #ffffff !important;
}

body[style*="background-color: rgb(40, 49, 68)"] .modal-content .modal-meta-label {
    color: #b8bbc1 !important;
}

body[style*="background-color: rgb(40, 49, 68)"] .modal-content .modal-description {
    color: #b8bbc1 !important;
}

body[style*="background-color: rgb(40, 49, 68)"] .modal-content .modal-specs {
    background: #151a24 !important;
}

body[style*="background-color: rgb(40, 49, 68)"] .modal-content .modal-specs h4 {
    color: #ffffff !important;
}

body[style*="background-color: rgb(40, 49, 68)"] .modal-content .modal-specs .spec-value {
    color: #ffffff !important;
}

body[style*="background-color: rgb(40, 49, 68)"] .modal-content .modal-specs .spec-label {
    color: #b8bbc1 !important;
}

body[style*="background-color: rgb(40, 49, 68)"] .modal-content .modal-specs li {
    border-bottom-color: #3E4B67 !important;
}

body[style*="background-color: rgb(40, 49, 68)"] .modal-content .modal-image-main {
    background: #151a24 !important;
}

/* Gallery Controls - Dark Mode Styles
   -------------------------------------------------------------------------- */

body[style*="background-color: rgb(40, 49, 68)"] .gallery-controls .form-select {
    background-color: #1e2835 !important;
    color: #ffffff !important;
    border-color: #3E4B67 !important;
}

body[style*="background-color: rgb(40, 49, 68)"] .gallery-controls .form-select:focus {
    border-color: #ee780e !important;
    box-shadow: 0 0 0 0.2rem rgba(238, 120, 14, 0.25) !important;
}

body[style*="background-color: rgb(40, 49, 68)"] .gallery-controls .form-select option {
    background-color: #1e2835 !important;
    color: #ffffff !important;
}

/* Scrollbar - Dark Mode Styles
   -------------------------------------------------------------------------- */

@media (min-width: 992px) {
    body[style*="background-color: rgb(40, 49, 68)"] .gallery-sidebar::-webkit-scrollbar-track {
        background: #151a24 !important;
    }

    body[style*="background-color: rgb(40, 49, 68)"] .gallery-sidebar::-webkit-scrollbar-thumb {
        background: #ee780e !important;
    }

    body[style*="background-color: rgb(40, 49, 68)"] .gallery-sidebar::-webkit-scrollbar-thumb:hover {
        background: #d66e0c !important;
    }
}
