/* ============================================================
   PROJECTS PAGE STYLES
   ============================================================ */

/* ===== Hero ===== */
.projects-page {
    padding-top: 100px;
    background: #F7FAFC;
    min-height: 100vh;
}

.projects-hero {
    padding: 60px 0 40px;
    background: linear-gradient(135deg, #0A2540 0%, #0E3A5C 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.projects-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(28,169,201,0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(255,122,0,0.08) 0%, transparent 50%);
    pointer-events: none;
}

.projects-hero .section-tag {
    background: rgba(28,169,201,0.2);
    color: #4DD0E1;
    border: 1px solid rgba(28,169,201,0.3);
}

.projects-hero-title {
    font-size: 2.5rem;
    font-weight: 900;
    margin: 15px 0;
    color: white;
}

.projects-hero-subtitle {
    color: rgba(255,255,255,0.75);
    font-size: 1.05rem;
    max-width: 650px;
    margin: 0 auto;
}

/* ===== Layout ===== */
.projects-content {
    padding: 50px 0 80px;
}

.projects-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 30px;
    align-items: start;
}

/* ===== Sidebar ===== */
.projects-sidebar {
    background: white;
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 130px);
    overflow-y: auto;
}

.projects-sidebar::-webkit-scrollbar {
    width: 5px;
}

.projects-sidebar::-webkit-scrollbar-thumb {
    background: #CBD5E0;
    border-radius: 5px;
}

/* Filters */
.sidebar-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid #F0F4F8;
}

.filter-btn {
    padding: 7px 13px;
    border-radius: 50px;
    background: #F7FAFC;
    color: #4A5568;
    border: 1px solid #E2E8F0;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: inherit;
}

.filter-btn:hover {
    background: #E0F6FB;
    border-color: #1CA9C9;
    color: #1CA9C9;
}

.filter-btn.active {
    background: linear-gradient(135deg, #1CA9C9, #0E7A94);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(28,169,201,0.3);
}

/* Projects List */
.projects-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.project-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    text-align: right;
    font-family: inherit;
    transition: all 0.3s;
    width: 100%;
}

.project-list-item:hover {
    background: #F0F9FF;
    border-color: rgba(28,169,201,0.15);
    transform: translateX(-3px);
}

.project-list-item.active {
    background: linear-gradient(135deg, #E0F6FB, #F0F9FF);
    border-color: #1CA9C9;
    box-shadow: 0 4px 15px rgba(28,169,201,0.15);
}

.project-list-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    font-size: 1rem;
}

.project-list-icon.network { background: linear-gradient(135deg, #1CA9C9, #0E7A94); }
.project-list-icon.security { background: linear-gradient(135deg, #FF7A00, #E56B00); }
.project-list-icon.infrastructure { background: linear-gradient(135deg, #6F42C1, #553098); }
.project-list-icon.software { background: linear-gradient(135deg, #28A745, #1E7E34); }

.project-list-content {
    flex: 1;
    min-width: 0;
}

.project-list-content h6 {
    font-size: 0.85rem;
    font-weight: 700;
    color: #0A2540;
    margin: 0 0 3px 0;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.project-list-meta {
    font-size: 0.7rem;
    color: #718096;
    display: flex;
    align-items: center;
    gap: 4px;
}

.project-list-meta i {
    color: #1CA9C9;
}

.no-projects {
    padding: 30px 20px;
    text-align: center;
    color: #A0AEC0;
    font-size: 0.88rem;
}

/* ===== Detail ===== */
.projects-detail {
    background: white;
    border-radius: 20px;
    padding: 35px 40px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    min-height: 500px;
}

.project-detail-header {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #F0F4F8;
}

.project-detail-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.project-detail-tag.network { background: #E0F6FB; color: #0E7A94; }
.project-detail-tag.security { background: #FFEDD5; color: #C2410C; }
.project-detail-tag.infrastructure { background: #EDE9FE; color: #553098; }
.project-detail-tag.software { background: #D1FAE5; color: #065F46; }

.project-detail-title {
    font-size: 1.6rem;
    font-weight: 900;
    color: #0A2540;
    margin: 0;
    line-height: 1.4;
}

/* Meta */
.project-detail-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 30px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 15px;
    background: #F7FAFC;
    border-radius: 12px;
    font-size: 0.85rem;
    color: #4A5568;
}

.meta-item i {
    color: #1CA9C9;
    font-size: 1.1rem;
}

.meta-item strong {
    color: #0A2540;
}

/* Sections */
.project-detail-section {
    margin-bottom: 30px;
}

.project-detail-section h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0A2540;
    margin-bottom: 15px;
}

.project-detail-section h4 i {
    color: #1CA9C9;
}

.project-detail-section p {
    color: #4A5568;
    line-height: 1.95;
    font-size: 0.95rem;
    text-align: justify;
    margin: 0;
}

.services-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
}

.services-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #F0F9FF;
    border-radius: 10px;
    font-size: 0.88rem;
    color: #4A5568;
    font-weight: 500;
}

.services-list li i {
    color: #28A745;
    font-size: 1rem;
    flex-shrink: 0;
}

/* Gallery */
.project-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.project-gallery-item {
    aspect-ratio: 4/3;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background: #E2E8F0;
    position: relative;
    transition: all 0.3s;
}

.project-gallery-item::after {
    content: '\F52A';
    font-family: 'bootstrap-icons';
    position: absolute;
    inset: 0;
    background: rgba(28,169,201,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.project-gallery-item:hover::after {
    opacity: 1;
}

.project-gallery-item:hover {
    transform: scale(1.03);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.project-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.no-images {
    grid-column: 1 / -1;
    padding: 40px;
    text-align: center;
    color: #A0AEC0;
    background: #F7FAFC;
    border-radius: 12px;
    font-size: 0.9rem;
}

/* CTA */
.project-detail-cta {
    margin-top: 35px;
    padding: 25px 30px;
    background: linear-gradient(135deg, #F0F9FF 0%, #E0F6FB 100%);
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    border-right: 4px solid #1CA9C9;
}

.project-detail-cta p {
    margin: 0;
    font-weight: 700;
    color: #0A2540;
    font-size: 1rem;
}

.btn-contact-us {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #FF7A00, #E56B00);
    color: white;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.3s;
    box-shadow: 0 6px 18px rgba(255,122,0,0.3);
    white-space: nowrap;
}

.btn-contact-us:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(255,122,0,0.4);
    color: white;
}

/* ===== Lightbox ===== */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(10,37,64,0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s;
    cursor: zoom-out;
}

.lightbox.show {
    opacity: 1;
}

.lightbox img {
    max-width: 95vw;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.5);
    animation: lightboxZoom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes lightboxZoom {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.lightbox-close {
    position: absolute;
    top: 25px;
    right: 30px;
    color: white;
    font-size: 2.5rem;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    transition: all 0.3s;
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.25);
    transform: rotate(90deg);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 991.98px) {
    .projects-page {
        padding-top: 80px;
    }
    
    .projects-hero {
        padding: 40px 0 30px;
    }
    
    .projects-hero-title {
        font-size: 1.8rem;
    }
    
    .projects-hero-subtitle {
        font-size: 0.9rem;
    }
    
    .projects-content {
        padding: 30px 0 50px;
    }
    
    .projects-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .projects-sidebar {
        position: static;
        max-height: none;
        padding: 18px;
    }
    
    .projects-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .projects-detail {
        padding: 25px 22px;
    }
    
    .project-detail-title {
        font-size: 1.3rem;
    }
}

@media (max-width: 576px) {
    .projects-hero-title {
        font-size: 1.5rem;
    }
    
    .projects-list {
        grid-template-columns: 1fr;
    }
    
    .projects-detail {
        padding: 20px 16px;
    }
    
    .project-detail-title {
        font-size: 1.15rem;
    }
    
    .project-detail-meta {
        grid-template-columns: 1fr;
    }
    
    .services-list {
        grid-template-columns: 1fr;
    }
    
    .project-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .project-detail-cta {
        padding: 18px;
        text-align: center;
        justify-content: center;
    }
    
    .btn-contact-us {
        width: 100%;
        justify-content: center;
    }
    
    .filter-btn {
        font-size: 0.7rem;
        padding: 6px 10px;
    }
}

/* ============================================================
   SIDEBAR SEARCH
   ============================================================ */
.sidebar-search {
    position: relative;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #F0F4F8;
}

.sidebar-search i {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #A0AEC0;
    font-size: 0.95rem;
    pointer-events: none;
    transition: color 0.25s;
}

.sidebar-search input {
    width: 100%;
    padding: 11px 40px 11px 14px;
    border: 1.5px solid #E2E8F0;
    border-radius: 12px;
    background: #F7FAFC;
    font-family: inherit;
    font-size: 0.85rem;
    color: #1A1A2E;
    transition: all 0.25s;
    outline: none;
}

.sidebar-search input::placeholder {
    color: #A0AEC0;
    font-size: 0.82rem;
}

.sidebar-search input:focus {
    border-color: #1CA9C9;
    background: white;
    box-shadow: 0 0 0 4px rgba(28, 169, 201, 0.1);
}

.sidebar-search input:focus + i,
.sidebar-search:focus-within i {
    color: #1CA9C9;
}

/* ★ دکمه پاک کردن سرچ — فقط ضربدر، بدون دایره */
.sidebar-search-clear {
    position: absolute;
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    height: auto;
    background: transparent;           /* ★ بدون پس‌زمینه */
    color: #A0AEC0;
    border: none;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1rem;                   /* ★ بزرگ‌تر برای وضوح */
    cursor: pointer;
    transition: color 0.2s;
    padding: 4px;
    line-height: 1;
}

.sidebar-search-clear:hover {
    background: transparent;           /* ★ بدون پس‌زمینه */
    color: #DC3545;                    /* ★ فقط رنگ عوض میشه */
}

.sidebar-search-clear.show {
    display: flex;
}

.sidebar-search-clear.show {
    display: flex;
}

/* ★ پیام خالی */
.search-empty {
    padding: 30px 20px;
    text-align: center;
    color: #A0AEC0;
    font-size: 0.85rem;
    line-height: 1.7;
}

.search-empty i {
    font-size: 2rem;
    display: block;
    margin-bottom: 10px;
    color: #CBD5E0;
}

.search-empty strong {
    color: #4A5568;
    font-weight: 700;
}

/* ★ ریسپانسیو */
@media (max-width: 991.98px) {
    .sidebar-search {
        margin-bottom: 12px;
        padding-bottom: 12px;
    }
    .sidebar-search input {
        padding: 10px 38px 10px 12px;
        font-size: 0.82rem;
    }
    .sidebar-search i {
        font-size: 0.88rem;
        right: 12px;
    }
}

/* ============================================================
   ★★★ DARK MODE — PROJECTS PAGE ★★★
   ============================================================ */
[data-theme="dark"] .projects-page {
    background: #0D1117;
}

[data-theme="dark"] .projects-hero {
    background: linear-gradient(135deg, #05080D 0%, #0A2540 100%);
}

[data-theme="dark"] .projects-sidebar {
    background: #1C2128;
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

[data-theme="dark"] .projects-sidebar::-webkit-scrollbar-thumb {
    background: #30363D;
}

[data-theme="dark"] .sidebar-filters {
    border-bottom-color: #30363D;
}

[data-theme="dark"] .filter-btn {
    background: #21262D;
    color: #B1BAC4;
    border-color: #30363D;
}

[data-theme="dark"] .filter-btn:hover {
    background: rgba(28, 169, 201, 0.15);
    border-color: #22B8D8;
    color: #4DD0E1;
}

[data-theme="dark"] .project-list-item:hover {
    background: rgba(28, 169, 201, 0.1);
    border-color: rgba(28, 169, 201, 0.3);
}

[data-theme="dark"] .project-list-item.active {
    background: rgba(28, 169, 201, 0.18);
    border-color: #22B8D8;
}

[data-theme="dark"] .project-list-content h6 {
    color: #E6EDF3;
}

[data-theme="dark"] .project-list-meta {
    color: #8B949E;
}

[data-theme="dark"] .projects-detail {
    background: #1C2128;
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

[data-theme="dark"] .project-detail-header {
    border-bottom-color: #30363D;
}

[data-theme="dark"] .project-detail-title {
    color: #E6EDF3;
}

[data-theme="dark"] .meta-item {
    background: #161B22;
    color: #B1BAC4;
}

[data-theme="dark"] .meta-item strong {
    color: #E6EDF3;
}

[data-theme="dark"] .project-detail-section h4 {
    color: #E6EDF3;
}

[data-theme="dark"] .project-detail-section p {
    color: #B1BAC4;
}

[data-theme="dark"] .services-list li {
    background: rgba(28, 169, 201, 0.1);
    color: #B1BAC4;
}

[data-theme="dark"] .project-gallery-item {
    background: #161B22;
}

[data-theme="dark"] .no-images {
    background: #161B22;
    color: #6E7681;
}

[data-theme="dark"] .project-detail-cta {
    background: linear-gradient(135deg, #1C2128 0%, #21262D 100%);
}

[data-theme="dark"] .project-detail-cta p {
    color: #E6EDF3;
}

[data-theme="dark"] .no-projects {
    color: #6E7681;
}

/* ★ Tags */
[data-theme="dark"] .project-detail-tag.network { background: rgba(28, 169, 201, 0.2); color: #4DD0E1; }
[data-theme="dark"] .project-detail-tag.security { background: rgba(255, 122, 0, 0.2); color: #FFA94D; }
[data-theme="dark"] .project-detail-tag.infrastructure { background: rgba(111, 66, 193, 0.25); color: #B197FC; }
[data-theme="dark"] .project-detail-tag.software { background: rgba(40, 167, 69, 0.2); color: #69DB7C; }

/* ★ Sidebar Search */
[data-theme="dark"] .sidebar-search {
    border-bottom-color: #30363D;
}

[data-theme="dark"] .sidebar-search input {
    background: #21262D;
    border-color: #30363D;
    color: #E6EDF3;
}

[data-theme="dark"] .sidebar-search input::placeholder {
    color: #6E7681;
}

[data-theme="dark"] .sidebar-search input:focus {
    background: #161B22;
    border-color: #22B8D8;
}

[data-theme="dark"] .sidebar-search-clear {
    color: #6E7681;
}

[data-theme="dark"] .search-empty {
    color: #6E7681;
}

[data-theme="dark"] .search-empty strong {
    color: #B1BAC4;
}

/* Fallback for aspect-ratio */
@supports not (aspect-ratio: 4/3) {
    .project-gallery-item {
        height: 0;
        padding-bottom: 75%;
        position: relative;
    }
    .project-gallery-item img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}