﻿/* gallery-styles.css */

/* ==================== Gallery Page Styles ==================== */

/* Gallery Hero Section */
.gallery-hero {
    background: var(--bodyColor);
    color: var(--primaryColor);
    position: relative;
    overflow: hidden;
    direction:rtl;
    align-items:start;
    text-align:start;
}

    .gallery-hero::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="camera" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="2" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23camera)"/></svg>');
*/        opacity: 0.3;
    }

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    line-height: 1.6;
}

.gallery-stats {
    display: flex;
    gap: 3rem;
    margin-top: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 3rem;
    font-weight: 700;
    color: var(--primaryColor);
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.stat-label {
    display: block;
    font-size: 1rem;
    opacity: 0.8;
    margin-top: 0.5rem;
}

/* Featured Gallery Grid in Hero */
.hero-gallery {
    position: relative;
    z-index: 2;
}

.featured-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 15px;
    height: 400px;
}

.featured-item {
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

.featured-1 {
    grid-row: span 2;
}

.featured-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
}

.featured-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

    .featured-item:hover img {
        transform: scale(1.05);
    }

.featured-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 1rem;
    color: var(--primaryColor);
    transform: translateY(100%);
    transition: all 0.3s ease;
}

.featured-item:hover .featured-overlay {
    transform: translateY(0);
}

.featured-overlay span {
    background: var(--brand-color);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Gallery Filters */
.gallery-filters {
    background: var(--box-color);
    border-bottom: 1px solid #dee2e6;
    position: relative;
    padding: 2rem 0;
}

.filter-container {
    background: var(--box-color);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    direction: rtl;
    position: relative;
    z-index: 2;
    border: 1px solid rgba(40, 167, 69, 0.1);
}

/* Search Box */
.search-box .form-label {
    color: var(--brand-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
}

.search-input {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: #fafafa;
    direction: rtl;
    width: 100%;
    letter-spacing: 0.2px;
}

    .search-input:focus {
        border-color: var(--brand-color);
        box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.15);
        background: var(--primaryColor);
        outline: none;
    }

    .search-input:focus-visible {
        outline: 2px solid var(--brand-color);
        outline-offset: 2px;
    }

    .search-input:hover {
        border-color: rgba(40, 167, 69, 0.4);
    }

    .search-input::placeholder {
        color: #6c757d;
        font-style: italic;
        font-size: 0.85rem;
    }

/* تحسين زر البحث */
.search-btn {
    background: var(--brand-color);
    color: var(--primaryColor);
    border: none;
    border-radius: 8px 0 0 8px; /* انحناء الزوايا اليمنى فقط */
    padding: 0.6rem 1rem;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 44px;
    height: 44px; /* نفس ارتفاع حقل البحث */
    width: 44px; /* نفس ارتفاع حقل البحث */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    margin-right: 0.5rem;
}

    .search-btn:hover {
        background: var(--bodyColor);
        color: var(--primaryColor);
        transform: translateY(-1px);
        box-shadow: 0 3px 8px rgba(40, 167, 69, 0.3);
    }

    .search-btn:focus {
        box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
        outline: none;
    }

    .search-btn:focus-visible {
        outline: 2px solid var(--brand-color);
        outline-offset: 2px;
    }

    .search-btn i {
        font-size: 0.8rem;
        color: var(--primaryColor);
    }

/* Category Filter */
.category-filter .form-label {
    color: var(--brand-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.category-select {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 0.6rem 1rem;
    min-width: 180px;
    transition: all 0.3s ease;
    background: #fafafa;
    direction: rtl;
    font-size: 0.9rem;
    height: 44px;
}

    .category-select:focus {
        border-color: var(--brand-color);
        box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.15);
        background: var(--primaryColor);
        outline: none;
    }

/* Search Results */
.search-results {
    background: var(--brand-color);
    border: 1px solid rgba(40, 167, 69, 0.2);
    border-radius: 8px;
    padding: 0.8rem 1.2rem;
    margin-top: 1rem;
    text-align: start;
    animation: fadeInUp 0.3s ease-out;
}

    .search-results p {
        margin: 0;
        color: var(--primaryColor);
        font-weight: 500;
        font-size: 0.9rem;
    }

/* Gallery Grid */
.gallery-grid {
    background: var(--bodyColor);
}

.gallery-item {
    background: var(--bodyColor);
    border-radius: 20px;
    overflow: hidden;
    /*box-shadow: 0 5px 15px rgba(0,0,0,0.08);*/
    transition: all 0.3s ease;
    height: 100%;
    position: relative;
    animation: fadeInUp 0.6s ease-out;
}

    .gallery-item:hover {
        transform: translateY(-10px);
        box-shadow: 0 15px 30px rgba(0,0,0,0.15);
    }

    .gallery-item.featured {
        border: 3px solid var(--bodyColor);
    }

.gallery-image {
    position: relative;
    height: 280px;
    overflow: hidden;
}

    .gallery-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: all 0.3s ease;
    }

.gallery-item:hover .gallery-image img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bodyColor);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    padding: 1.5rem;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.overlay-content {
    text-align: center;
    color: var(--primaryColor);
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.gallery-item:hover .overlay-content {
    transform: translateY(0);
}

.category-badge {
    background: rgba(255,255,255,0.2);
    color: var(--primaryColor);
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: inline-block;
    backdrop-filter: blur(10px);
}

.gallery-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    color: var(--primaryColor);
}

.gallery-description {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    line-height: 1.4;
    color: var(--primaryColor);
}

.gallery-actions {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    flex-wrap: wrap;
}

    .gallery-actions .btn {
        padding: 0.5rem 1rem;
        border-radius: 20px;
        font-size: 0.85rem;
        font-weight: 600;
        transition: all 0.3s ease;
    }

    .gallery-actions .btn-primary {
        background: var(--primaryColor);
        color: var(--brand-color);
        border: none;
    }

        .gallery-actions .btn-primary:hover {
            background: #f8f9fa;
            transform: translateY(-2px);
        }

    .gallery-actions .btn-outline-light:hover {
        background: rgba(255,255,255,0.2);
        transform: translateY(-2px);
    }

/* Featured Badge */
.featured-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #ffc107, #ff8c00);
    color: var(--primaryColor);
    padding: 0.5rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    z-index: 3;
    box-shadow: 0 3px 10px rgba(255, 193, 7, 0.4);
    animation: pulse 2s infinite;
}

/* Gallery Details Page */
.gallery-details-hero {
    background: var(--bodyColor);
    min-height: auto;
    padding: 2rem 0;
    direction: rtl;
    align-items: start;
    text-align: start;
}

.main-image-container {
    position: relative;
    margin-bottom: 2rem;
}

.main-image {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    background: var(--bodyColor);
}

    .main-image img {
        width: 100%;
        height: auto;
        max-height: 70vh;
        object-fit: contain;
        display: block;
    }

.image-actions {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    transition: all 0.3s ease;
}

.main-image:hover .image-actions {
    opacity: 1;
}

.btn-action {
    border-radius: 50px;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    var(--primaryColor)-space: nowrap;
    color: var(--primaryColor);
    background: var(--boxColor);
}

    .btn-action:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    }

/* Image Info Card */
.image-info {
    height: fit-content;
}

.info-card {
    background: var(--boxColor);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    position: sticky;
    top: 100px;
}

.category-badge-large {
    background: var(--bodyColor);
    color: var(--primaryColor);
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: inline-flex;
    align-items: center;
}

.image-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primaryColor);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.image-description {
    color: var(--primaryColor);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.image-meta {
    margin-bottom: 2rem;
}

.meta-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    color: #495057;
    font-size: 0.95rem;
}

    .meta-item i {
        color: var(--brand-color);
        width: 20px;
    }

/* Social Share */
.social-share h6 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 1rem;
}

.share-buttons {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

    .share-buttons .btn {
        width: 45px;
        height: 45px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.1rem;
        transition: all 0.3s ease;
        border: none;
    }

.btn-facebook {
    background: #1877f2;
    color: var(--primaryColor);
}

.btn-twitter {
    background: #1da1f2;
    color: var(--primaryColor);
}

.btn-whatsapp {
    background: #25d366;
    color: var(--primaryColor);
}

.share-buttons .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Related Gallery */
.related-gallery {
    background: var(--bodyColor);
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primaryColor);
    position: relative;
    margin-bottom: 1rem;
}

    .section-title::after {
        content: '';
        position: absolute;
        bottom: -10px;
        left: 50%;
        transform: translateX(-50%);
        width: 60px;
        height: 3px;
        background: var(--brand-color);
        border-radius: 3px;
    }

.section-subtitle {
    color: #6c757d;
    font-size: 1.1rem;
    margin-bottom: 0;
}

.related-item {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    background: var(--primaryColor);
}

    .related-item:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    }

.related-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

    .related-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: all 0.3s ease;
    }

.related-item:hover .related-image img {
    transform: scale(1.1);
}

.related-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bodyColor);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    padding: 1rem;
}

.related-item:hover .related-overlay {
    opacity: 1;
}

.related-overlay .overlay-content {
    text-align: center;
    color: var(--primaryColor);
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.related-item:hover .related-overlay .overlay-content {
    transform: translateY(0);
}

.related-overlay h5 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* No Results */
.no-results {
    background: var(--boxColor);
    border-radius: 12px;
    padding: 3rem 2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin: 2rem 0;
    text-align: center;
}

.no-results-icon i {
    font-size: 4rem !important;
    color: var(--primaryColor);
    margin-bottom: 1.5rem;
}

.no-results-title {
    color: var(--primaryColor);
    margin-bottom: 1rem;
    font-weight: 600;
    font-size: 1.5rem;
}

.no-results-text {
    color: var(--primaryColor);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

/* Loading Spinner */
.loading-spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    background: rgba(255,255,255,0.95);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    backdrop-filter: blur(5px);
}

/* Toast Message */
.toast-message {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--brand-color);
    color: var(--primaryColor);
    padding: 1rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
    z-index: 10000;
    animation: slideInRight 0.3s ease-out;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .gallery-stats {
        gap: 2rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .featured-grid {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, 1fr);
        height: 600px;
    }

    .featured-1 {
        grid-row: span 2;
    }

    .filter-container form {
        flex-direction: column;
        align-items: stretch !important;
        gap: 1rem;
    }

    .search-box {
        position: relative;
        max-width: 350px;
    }

    .category-select {
        min-width: auto;
        width: 100%;
    }

    .gallery-actions {
        flex-direction: column;
        align-items: center;
    }

        .gallery-actions .btn {
            width: 80%;
        }

    .image-title {
        font-size: 1.5rem;
    }

    .info-card {
        margin-top: 2rem;
        position: static;
    }

    .image-actions {
        position: static;
        opacity: 1;
        flex-direction: row;
        justify-content: center;
        margin-top: 1rem;
        background: var(--primaryColor);
        padding: 1rem;
        border-radius: 15px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    }

    .main-image {
        margin-bottom: 0;
    }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 2rem;
    }

    .gallery-stats {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .featured-grid {
        height: 400px;
    }

    .gallery-item {
        margin-bottom: 1rem;
    }

    .image-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .btn-action {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    .share-buttons {
        justify-content: center;
    }

    .related-image {
        height: 150px;
    }
}


/* أستايل للصور الافتراضية */
.fallback-image {
    opacity: 0.7;
    filter: grayscale(20%);
}

.gallery-image .fallback-image {
    object-fit: contain !important;
    background-color: #f8f9fa;
}

/* مؤشر للصور المكسورة */
.image-error-indicator {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 193, 7, 0.9);
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}
