/* Portfolio Section - Advanced for Home Page */
.portfolio-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.portfolio-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="dots" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="rgba(102,126,234,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23dots)"/></svg>');
    opacity: 0.3;
}

.portfolio-section .container {
    position: relative;
    z-index: 2;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header .section-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 20px;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.section-header p {
    font-size: 1.2rem;
    color: #718096;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Portfolio Filter Mini */
.portfolio-filter-mini {
    margin-bottom: 40px;
    text-align: center;
}

.portfolio-filter-mini .filter-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
}

.portfolio-filter-mini .filter-btn {
    background: white;
    border: 2px solid #e9ecef;
    color: #495057;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    font-size: 0.9rem;
}

.portfolio-filter-mini .filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.2);
}

.portfolio-filter-mini .filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

/* Mobile Filter Position */
@media (max-width: 768px) {
    .portfolio-filter-mini {
        margin: 20px 0;
        padding: 0 15px;
    }
    
    .portfolio-filter-mini .filter-buttons {
        gap: 10px;
        justify-content: center;
    }
    
    .portfolio-filter-mini .filter-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
        border-radius: 20px;
    }
}

/* Portfolio Grid */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.portfolio-item {
    position: relative;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.12);
    transition: all 0.4s ease;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(99, 102, 241, 0.12);
    cursor: pointer;
}

.portfolio-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
    border-color: rgba(99, 102, 241, 0.32);
}

.portfolio-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

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

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

.series-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--gradient-main);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 8px 18px rgba(99, 102, 241, 0.3);
    z-index: 2;
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(14, 165, 233, 0.85), rgba(99, 102, 241, 0.88), rgba(168, 85, 247, 0.85));
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    padding: 20px;
    backdrop-filter: blur(5px);
}

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

.portfolio-info h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.portfolio-info p {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 15px;
    line-height: 1.5;
}

.portfolio-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    opacity: 0.8;
    gap: 10px;
}

.portfolio-date,
.portfolio-category {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Portfolio Stats Mini */
.portfolio-stats-section {
    background: #1A1A1A;
    padding: 60px 0;
}

.portfolio-stats-mini {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 25px;
    margin: 50px 0;
    padding: 50px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    color: #F9F9F9;
}

.portfolio-stats-mini .stat-item {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 25px 15px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.portfolio-stats-mini .stat-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.2);
}

.portfolio-stats-mini .stat-icon {
    font-size: 2.2rem;
    margin-bottom: 12px;
    opacity: 0.8;
}

.portfolio-stats-mini .stat-content h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.portfolio-stats-mini .stat-content p {
    font-size: 1rem;
    opacity: 0.9;
}

/* Portfolio Actions */
.portfolio-actions {
    text-align: center;
    margin-top: 40px;
}

.portfolio-actions .btn {
    margin: 0 10px;
    padding: 15px 30px;
    border-radius: 25px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.portfolio-actions .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

.portfolio-actions .btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.portfolio-actions .btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.1);
}

.portfolio-actions .btn-secondary:hover {
    background: #667eea;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

/* Portfolio Modal */
.portfolio-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    backdrop-filter: blur(5px);
}

.portfolio-modal .modal-content {
    position: relative;
    margin: 5% auto;
    width: 90%;
    max-width: 800px;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
}

.portfolio-modal .close-modal {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    background: rgba(0,0,0,0.5);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.portfolio-modal .close-modal:hover {
    background: rgba(0,0,0,0.8);
    transform: scale(1.1);
}

.portfolio-modal .modal-body {
    padding: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.portfolio-modal .modal-body img {
    width: 100%;
    height: auto;
    max-height: 85vh;
    object-fit: contain;
    display: block;
}

/* Animations */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Mobile Portfolio Slider */
.portfolio-slider-container {
    position: relative;
    overflow: hidden;
    margin-bottom: 30px;
    width: 100%;
    z-index: 1;
    background: transparent;
    padding: 0 10px;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .portfolio-slider-container {
        display: block !important;
    }
}

.portfolio-slider {
    display: flex !important;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    position: relative;
    will-change: transform;
    direction: ltr; /* برای slider از LTR استفاده می‌کنیم */
    z-index: 1;
    background: transparent;
}

.portfolio-slide {
    min-width: 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    display: block !important;
    position: relative;
    box-sizing: border-box;
}

/* Dual date utility */
.dual-date {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    white-space: nowrap;
}
.dual-date .date-fa {
    font-weight: 700;
    direction: rtl;
    unicode-bidi: plaintext;
}
.dual-date .date-en {
    opacity: 0.8;
    font-size: 0.9em;
    direction: ltr;
    unicode-bidi: plaintext;
}

/* Meta alignment */
.portfolio-meta,
.portfolio-meta-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.portfolio-meta .portfolio-date,
.portfolio-meta-top .portfolio-date {
    direction: ltr;
    text-align: left;
}
.portfolio-meta .portfolio-category,
.portfolio-meta-top .portfolio-category {
    text-align: right;
}

.portfolio-slide .portfolio-item {
    margin: 0 !important;
    width: 100% !important;
    height: auto !important;
    background: transparent !important; /* حذف background سفید */
    position: relative;
    z-index: 1;
}

/* Portfolio Image Quality in Slider */
.portfolio-slide .portfolio-item .portfolio-image {
    width: 100% !important;
    max-width: 100% !important;
    position: relative !important;
    overflow: visible !important;
    background: white !important; /* پس‌زمینه سفید */
    z-index: 1;
    height: 300px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.portfolio-slide .portfolio-item .portfolio-image img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important; /* نمایش کامل عکس */
    object-position: center center !important;
    display: block !important;
    position: relative !important;
    z-index: 2 !important;
}

/* Hover effect for slider images */
.portfolio-slide .portfolio-item:hover .portfolio-image img {
    transform: scale(1.05) !important;
    transition: transform 0.4s ease;
}

.portfolio-slide .portfolio-item .portfolio-overlay {
    z-index: 3 !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    pointer-events: none;
}

.portfolio-slide .portfolio-item:hover .portfolio-overlay {
    pointer-events: auto;
}

.slider-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

.slider-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

.slider-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.slider-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.slider-dots {
    display: flex;
    gap: 10px;
    align-items: center;
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e9ecef;
    cursor: pointer;
    transition: all 0.3s ease;
}

.slider-dot.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: scale(1.2);
}

.slider-progress {
    width: 100%;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 15px;
}

.slider-progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Portfolio Responsive */
@media (max-width: 768px) {
    .portfolio-section {
        padding: 60px 0;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .portfolio-grid {
        display: none; /* Hide grid on mobile */
    }
    
    .portfolio-slider-container {
        display: block; /* Show slider on mobile */
    }
    
    /* Modern Portfolio Cards for Mobile */
    .portfolio-slide {
        min-width: 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        flex-shrink: 0 !important;
        flex-grow: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
        display: block !important;
    }
    
    .portfolio-slide .portfolio-item {
        background: white !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 15px !important;
        overflow: hidden !important;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1) !important;
        display: flex !important;
        flex-direction: column !important;
        border: none !important;
    }
    
    /* Card Header - مشخصات بالا */
    .portfolio-slide .portfolio-item .portfolio-card-header {
        background: linear-gradient(135deg, #5f72ff 0%, #7c5dff 40%, #a84bff 70%, #ff6ad5 100%) !important;
        padding: 8px 12px !important;
        color: white !important;
        border: none !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 6px !important;
    text-align: right !important;
    }
    
    .portfolio-slide .portfolio-item .portfolio-card-header h3 {
        font-size: 0.85rem !important;
        font-weight: 700 !important;
        margin-bottom: 3px !important;
        color: white !important;
        line-height: 1.2 !important;
    width: 100% !important;
    text-align: right !important;
    }
    
    .portfolio-slide .portfolio-item .portfolio-card-header .portfolio-meta-top {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        font-size: 0.65rem !important;
        opacity: 0.9 !important;
        margin-top: 3px !important;
        flex-wrap: wrap !important;
        gap: 5px !important;
    width: 100% !important;
    }
    
    .portfolio-slide .portfolio-item .portfolio-card-header .portfolio-meta-top span {
        display: flex !important;
        align-items: center !important;
        gap: 3px !important;
        color: white !important;
    }

.portfolio-slide .portfolio-item .portfolio-card-header .portfolio-meta-top .portfolio-date {
    direction: ltr !important;
    text-align: left !important;
    flex-direction: row-reverse !important; /* icon on the right */
}
.portfolio-slide .portfolio-item .portfolio-card-header .portfolio-meta-top .portfolio-category {
    text-align: right !important;
}
    
    /* Card Image */
    .portfolio-slide .portfolio-item .portfolio-image {
        width: 100% !important;
        max-width: 100% !important;
        height: 200px !important;
        background: white !important;
        position: relative !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        overflow: hidden;
    }
    
    .portfolio-slide .portfolio-item .portfolio-image img {
        max-width: 100% !important;
        max-height: 100% !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain !important;
        object-position: center center !important;
        display: block !important;
    }
    
    /* Card Footer - مشخصات پایین و دکمه */
    .portfolio-slide .portfolio-item .portfolio-card-footer {
        background: linear-gradient(135deg, #f8f9ff 0%, #eef1ff 35%, #e4e8ff 70%, #f8f9ff 100%) !important;
        padding: 8px 12px !important;
        border: none !important;
    }
    
    .portfolio-slide .portfolio-item .portfolio-card-footer p {
        font-size: 0.7rem !important;
        color: #495057 !important;
        margin-bottom: 6px !important;
        line-height: 1.3 !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
    }
    
    .portfolio-slide .portfolio-item .portfolio-card-footer .view-btn {
        width: 100% !important;
        padding: 7px 14px !important;
        background: linear-gradient(135deg, #5f72ff 0%, #6b66ff 25%, #7c5dff 50%, #a84bff 80%, #ff6ad5 100%) !important;
        color: white !important;
        border: none !important;
        border-radius: 15px !important;
        font-size: 0.8rem !important;
        font-weight: 600 !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
        box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3) !important;
    }
    
    .portfolio-slide .portfolio-item .portfolio-card-footer .view-btn:hover {
        background: linear-gradient(135deg, #4f8bff 0%, #5f72ff 25%, #7c5dff 55%, #b14bff 85%, #ff7adf 100%) !important;
        transform: translateY(-2px) !important;
        box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4) !important;
    }
    
    .portfolio-slide .portfolio-item .portfolio-card-footer .view-btn:active {
        transform: translateY(0) !important;
    }
    
    /* Hide overlay in mobile cards */
    .portfolio-slide .portfolio-item .portfolio-overlay {
        display: none !important;
    }

/* Portfolio Gallery Modal - Modern Design */
.portfolio-gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
    animation: fadeIn 0.3s ease;
}

.gallery-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.gallery-modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
        #0f1b3f 0%,
        #182a68 25%,
        #233d92 50%,
        #2f4fb8 70%,
        #5f72ff 100%);
    display: flex;
    flex-direction: column;
    z-index: 2;
    overflow-y: auto;
}

.gallery-close-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.gallery-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Gallery header removed */

.gallery-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 60px 20px 20px;
    gap: 20px;
}

.gallery-image-container {
    position: relative;
    width: 100%;
    flex: 1;
    min-height: 300px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.gallery-zoom-controls {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 8px;
    z-index: 5;
}

.gallery-zoom-controls .zoom-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: linear-gradient(135deg,
        rgba(95, 114, 255, 0.8) 0%,
        rgba(124, 93, 255, 0.85) 50%,
        rgba(255, 106, 213, 0.8) 100%);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    transition: all 0.2s ease;
    backdrop-filter: blur(6px);
}

.gallery-zoom-controls .fullscreen-btn {
    width: 44px;
    height: 44px;
}

.gallery-zoom-controls .zoom-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0,0,0,0.3);
}

.gallery-zoom-controls .zoom-btn:active {
    transform: translateY(0);
}

.gallery-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.gallery-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 10;
}

.gallery-nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
    border-color: rgba(255, 255, 255, 0.6);
}

.gallery-prev {
    right: 20px;
}

.gallery-next {
    left: 20px;
}

.gallery-info {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.gallery-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 10px;
}

.gallery-info p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin-bottom: 15px;
}

.gallery-meta {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.gallery-meta span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gallery-thumbnails {
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.thumbnails-container {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0;
    scroll-behavior: smooth;
}

.thumbnails-container::-webkit-scrollbar {
    height: 6px;
}

.thumbnails-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.thumbnails-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.gallery-thumbnail {
    min-width: 80px;
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.gallery-thumbnail:hover {
    opacity: 1;
    transform: scale(1.1);
}

.gallery-thumbnail.active {
    border-color: #667eea;
    opacity: 1;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .gallery-header {
        padding: 20px 15px 15px;
    }
    
    .gallery-title {
        font-size: 1.5rem;
    }
    
    .gallery-main {
        padding: 15px;
        gap: 15px;
    }
    
    .gallery-image-container {
        min-height: 250px;
        padding: 15px;
    }
    
    .gallery-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .gallery-prev {
        right: 10px;
    }
    
    .gallery-next {
        left: 10px;
    }
    
    .gallery-info {
        padding: 15px;
    }
    
    .gallery-info h3 {
        font-size: 1.3rem;
    }
    
    .gallery-thumbnails {
        padding: 15px;
    }
    
    .gallery-thumbnail {
        min-width: 60px;
        width: 60px;
        height: 60px;
    }
    }
    
    .portfolio-stats-mini {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        padding: 30px 20px;
    }
    
    .portfolio-actions .btn {
        display: block;
        margin: 10px auto;
        width: 100%;
        max-width: 300px;
    }
    
    .portfolio-modal .modal-content {
        margin: 10% auto;
        width: 95%;
    }
}

@media (min-width: 769px) {
    .portfolio-slider-container {
        display: none; /* Hide slider on desktop */
    }
    
    .portfolio-grid {
        display: grid; /* Show grid on desktop */
    }
    
    .portfolio-gallery-modal,
    .gallery-modal-content {
        display: none !important; /* Hide gallery modal on desktop */
    }
}

@media (max-width: 480px) {
    .portfolio-stats-mini {
        grid-template-columns: 1fr;
    }
    
    .portfolio-stats-mini .stat-item {
        padding: 20px 15px;
    }
    
    /* Adjust image height for smaller screens */
    .portfolio-slide .portfolio-item {
        width: 100% !important;
        max-width: 100% !important;
        background: white !important;
    }
    
    .portfolio-slide .portfolio-item .portfolio-image {
        width: 100% !important;
        max-width: 100% !important;
        height: 300px !important;
        background: white !important; /* پس‌زمینه سفید */
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .portfolio-slide .portfolio-item .portfolio-image img {
        max-width: 100% !important;
        max-height: 100% !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain !important; /* نمایش کامل عکس */
    }
}
