/* ==================== */
/* CUSTOM SCROLLBAR */
/* ==================== */

/* For Webkit browsers (Chrome, Safari, Edge) */
.gallery-modal-container::-webkit-scrollbar,
.preview-iframe-container::-webkit-scrollbar,
.demo-sidebar::-webkit-scrollbar {
    width: 12px;
}

.gallery-modal-container::-webkit-scrollbar-track,
.preview-iframe-container::-webkit-scrollbar-track,
.demo-sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.gallery-modal-container::-webkit-scrollbar-thumb,
.preview-iframe-container::-webkit-scrollbar-thumb,
.demo-sidebar::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.5), rgba(255, 0, 255, 0.5));
    border-radius: 10px;
    border: 2px solid rgba(0, 0, 0, 0.3);
}

.gallery-modal-container::-webkit-scrollbar-thumb:hover,
.preview-iframe-container::-webkit-scrollbar-thumb:hover,
.demo-sidebar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.7), rgba(255, 0, 255, 0.7));
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

body.dark-theme .gallery-modal-container::-webkit-scrollbar-thumb,
body.dark-theme .preview-iframe-container::-webkit-scrollbar-thumb,
body.dark-theme .demo-sidebar::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.6), rgba(255, 0, 255, 0.6));
    box-shadow: 0 0 5px rgba(0, 240, 255, 0.3);
}

body.dark-theme .gallery-modal-container::-webkit-scrollbar-thumb:hover,
body.dark-theme .preview-iframe-container::-webkit-scrollbar-thumb:hover,
body.dark-theme .demo-sidebar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.8), rgba(255, 0, 255, 0.8));
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.6);
}

/* For Firefox */
.gallery-modal-container,
.preview-iframe-container,
.demo-sidebar {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 240, 255, 0.5) rgba(0, 0, 0, 0.3);
}

body.dark-theme .gallery-modal-container,
body.dark-theme .preview-iframe-container,
body.dark-theme .demo-sidebar {
    scrollbar-color: rgba(0, 240, 255, 0.6) rgba(0, 0, 0, 0.5);
}

/* ==================== */
/* WORK GALLERY MODAL */
/* ==================== */

.work-gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    padding: 2rem;
}

.work-gallery-modal.active {
    display: flex;
}

.gallery-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(15px);
    animation: fadeIn 0.3s ease;
    cursor: pointer;
    z-index: 1;
}

.gallery-modal-container {
    position: relative;
    background: var(--bg-primary);
    border: 2px solid rgba(0, 240, 255, 0.3);
    border-radius: 20px;
    max-width: 1200px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    z-index: 2;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    padding: 3rem 2.5rem;
}

body.dark-theme .gallery-modal-container {
    background: linear-gradient(135deg, rgba(10, 10, 10, 0.98), rgba(20, 20, 20, 0.98));
    border-color: rgba(0, 255, 255, 0.4);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.9),
        0 0 40px rgba(0, 255, 255, 0.2),
        inset 0 1px 0 rgba(0, 255, 255, 0.1);
}

.gallery-close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 0, 0, 0.1);
    border: 2px solid rgba(255, 0, 0, 0.3);
    color: #ff0080;
    font-size: 1.3rem;
    cursor: pointer !important;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999 !important;
    pointer-events: auto !important;
}

.gallery-close-btn:hover {
    background: rgba(255, 0, 0, 0.2);
    transform: rotate(90deg) scale(1.1);
}

body.dark-theme .gallery-close-btn {
    background: rgba(255, 0, 128, 0.2);
    border-color: rgba(255, 0, 128, 0.5);
    box-shadow: 0 0 10px rgba(255, 0, 128, 0.3);
}

body.dark-theme .gallery-close-btn:hover {
    background: rgba(255, 0, 128, 0.3);
    box-shadow: 0 0 20px rgba(255, 0, 128, 0.5);
}

/* Gallery Header */
.gallery-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid rgba(0, 240, 255, 0.2);
}

.gallery-header-icon {
    width: 70px;
    height: 70px;
    border-radius: 15px;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(255, 0, 255, 0.2));
    border: 2px solid rgba(0, 240, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--neon-cyan);
}

body.dark-theme .gallery-header-icon {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.25), rgba(255, 0, 255, 0.25));
    border-color: rgba(0, 240, 255, 0.5);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
}

body.dark-theme .gallery-header-icon i {
    text-shadow: 0 0 15px rgba(0, 255, 255, 0.8);
}

.gallery-header-text h2 {
    font-size: 2rem;
    margin: 0 0 0.5rem 0;
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-pink));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.gallery-header-text p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding: 0.5rem;
}

.gallery-item {
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(0, 240, 255, 0.2);
    border-radius: 15px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.gallery-item:hover {
    background: rgba(0, 240, 255, 0.1);
    border-color: rgba(0, 240, 255, 0.5);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 240, 255, 0.3);
}

body.dark-theme .gallery-item {
    background: rgba(0, 240, 255, 0.05);
    border-color: rgba(0, 240, 255, 0.3);
}

body.dark-theme .gallery-item:hover {
    background: rgba(0, 240, 255, 0.15);
    border-color: rgba(0, 240, 255, 0.6);
    box-shadow: 0 10px 40px rgba(0, 240, 255, 0.4);
}

.gallery-item-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.15), rgba(255, 0, 255, 0.15));
    border: 1px solid rgba(0, 240, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--neon-cyan);
    margin-bottom: 1.5rem;
}

body.dark-theme .gallery-item-icon {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(255, 0, 255, 0.2));
    border-color: rgba(0, 240, 255, 0.4);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
}

body.dark-theme .gallery-item-icon i {
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.6);
}

.gallery-item-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.gallery-item-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.gallery-item-badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background: rgba(0, 240, 255, 0.2);
    border: 1px solid rgba(0, 240, 255, 0.4);
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--neon-cyan);
    font-weight: 600;
}

body.dark-theme .gallery-item-badge {
    background: rgba(0, 240, 255, 0.25);
    border-color: rgba(0, 240, 255, 0.5);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

/* Empty State */
.gallery-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.gallery-empty i {
    font-size: 4rem;
    color: var(--neon-cyan);
    opacity: 0.3;
    margin-bottom: 1.5rem;
}

.gallery-empty h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.gallery-empty p {
    font-size: 1rem;
}

/* ==================== */
/* WORK PREVIEW MODAL */
/* ==================== */

.work-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10003;
    padding: 0;
}

.work-preview-modal.active {
    display: flex;
}

.preview-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    animation: fadeIn 0.3s ease;
    cursor: pointer;
    z-index: 1;
}

.preview-modal-container {
    position: relative;
    background: var(--bg-primary);
    border: 2px solid rgba(0, 240, 255, 0.3);
    border-radius: 20px;
    width: 95vw;
    height: 90vh;
    max-width: 1800px;
    overflow: hidden;
    z-index: 2;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
}

body.dark-theme .preview-modal-container {
    background: linear-gradient(135deg, rgba(10, 10, 10, 0.98), rgba(20, 20, 20, 0.98));
    border-color: rgba(0, 255, 255, 0.4);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.9),
        0 0 40px rgba(0, 255, 255, 0.2),
        inset 0 1px 0 rgba(0, 255, 255, 0.1);
}

.preview-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 0, 0, 0.1);
    border: 2px solid rgba(255, 0, 0, 0.3);
    color: #ff0080;
    font-size: 1.3rem;
    cursor: pointer !important;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999 !important;
    pointer-events: auto !important;
}

.preview-close-btn:hover {
    background: rgba(255, 0, 0, 0.2);
    transform: rotate(90deg) scale(1.1);
}

body.dark-theme .preview-close-btn {
    background: rgba(255, 0, 128, 0.2);
    border-color: rgba(255, 0, 128, 0.5);
    box-shadow: 0 0 10px rgba(255, 0, 128, 0.3);
}

body.dark-theme .preview-close-btn:hover {
    background: rgba(255, 0, 128, 0.3);
    box-shadow: 0 0 20px rgba(255, 0, 128, 0.5);
}

/* Preview Header */
.preview-header {
    padding: 2rem 2.5rem;
    border-bottom: 2px solid rgba(0, 240, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    position: relative;
    z-index: 100;
}

.preview-info h3 {
    font-size: 1.8rem;
    margin: 0 0 0.5rem 0;
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-pink));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.preview-info p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0;
}

.preview-open-btn {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(255, 0, 255, 0.2));
    border: 1px solid rgba(0, 240, 255, 0.4);
    border-radius: 10px;
    color: var(--neon-cyan);
    font-size: 0.95rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    white-space: nowrap;
    cursor: pointer !important;
    pointer-events: auto !important;
    z-index: 9999 !important;
    position: relative;
}

.preview-open-btn:hover {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.3), rgba(255, 0, 255, 0.3));
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 240, 255, 0.3);
}

body.dark-theme .preview-open-btn {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.25), rgba(255, 0, 255, 0.25));
    border-color: rgba(0, 240, 255, 0.5);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

body.dark-theme .preview-open-btn:hover {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.35), rgba(255, 0, 255, 0.35));
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
}

/* Preview Iframe Container */
.preview-iframe-container {
    flex: 1;
    position: relative;
    background: #000;
}

.preview-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    z-index: 10;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.preview-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 240, 255, 0.2);
    border-top-color: var(--neon-cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.preview-loading span {
    color: var(--neon-cyan);
    font-size: 1rem;
}

#previewIframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
}

/* Gallery Button Styling */
.pricing-btn-gallery {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.15), rgba(138, 43, 226, 0.15));
    border: 1px solid rgba(0, 240, 255, 0.4);
    color: var(--neon-cyan);
}

.pricing-btn-gallery:hover {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.25), rgba(138, 43, 226, 0.25));
    border-color: rgba(0, 240, 255, 0.6);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
}

body.dark-theme .pricing-btn-gallery {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(138, 43, 226, 0.2));
    border-color: rgba(0, 240, 255, 0.5);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

body.dark-theme .pricing-btn-gallery:hover {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.3), rgba(138, 43, 226, 0.3));
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.4);
}

/* Responsive */
@media (max-width: 900px) {
    .work-gallery-modal {
        padding: 1rem;
    }
    
    .gallery-modal-container {
        padding: 2rem 1.5rem;
        max-height: 90vh;
    }
    
    .gallery-header {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 2rem;
        padding-bottom: 1.5rem;
    }
    
    .gallery-header-icon {
        width: 60px;
        height: 60px;
        font-size: 1.8rem;
    }
    
    .gallery-header-text h2 {
        font-size: 1.6rem;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .preview-modal-container {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }
    
    .preview-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.5rem 1rem;
    }
    
    .preview-info h3 {
        font-size: 1.4rem;
    }
    
    .preview-open-btn {
        width: 100%;
        justify-content: center;
    }
    
    .gallery-close-btn,
    .preview-close-btn {
        width: 40px;
        height: 40px;
        top: 0.75rem;
        right: 0.75rem;
    }
}

