/* Gallery CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #43cea2 0%, #185a9d 100%);
    background-attachment: fixed;
    color: #333;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></svg>');
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    animation: fadeIn 1s ease-out;
}

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

header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
    border-top: 5px solid #FF6B6B;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1) 0%, rgba(41, 128, 185, 0.1) 100%);
    z-index: -1;
}

header h1 {
    font-size: 2.8rem;
    color: #2c3e50;
    margin-bottom: 0.8rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    background: linear-gradient(to right, #FF6B6B, #556270);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

header p {
    font-size: 1.2rem;
    color: #7f8c8d;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

header p::after {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    background: linear-gradient(to right, #FF6B6B, #556270);
    margin: 15px auto 0;
    border-radius: 3px;
}

/* Districts Grid */
.districts-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2.5rem;
    perspective: 1000px;
}

.district-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1), 0 6px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    transform-style: preserve-3d;
    animation: cardAppear 0.6s ease-out forwards;
    opacity: 0;
    transform: translateY(20px) rotateX(5deg);
    animation-fill-mode: both;
}

.district-card:nth-child(odd) {
    animation-delay: 0.1s;
}

.district-card:nth-child(even) {
    animation-delay: 0.2s;
}

@keyframes cardAppear {
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0);
    }
}

.district-card:hover {
    transform: translateY(-15px) scale(1.03);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.district-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 8px;
    background: linear-gradient(90deg, #FF6B6B, #4ECDC4);
    z-index: 1;
}

.district-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1) 0%, rgba(78, 205, 196, 0.1) 100%);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.district-card:hover::after {
    opacity: 1;
}

.district-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: #ffffff;
    height: 80px;
    width: 80px;
    line-height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF6B6B, #4ECDC4);
    margin: 0 auto 1.5rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 2;
}

.district-icon::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(135deg, #FF6B6B, #4ECDC4);
    border-radius: 50%;
    z-index: -1;
    opacity: 0.3;
    filter: blur(8px);
    transition: all 0.4s ease;
}

.district-card:hover .district-icon {
    transform: scale(1.15) translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.district-card:hover .district-icon::after {
    opacity: 0.6;
    filter: blur(12px);
}

.district-name {
    font-size: 1.6rem;
    margin-bottom: 0.8rem;
    color: #2c3e50;
    font-weight: 600;
    position: relative;
    display: inline-block;
}

.district-name::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, #FF6B6B, #4ECDC4);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.district-card:hover .district-name::after {
    width: 60px;
}

.district-info {
    font-size: 1rem;
    color: #7f8c8d;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.view-btn {
    background: linear-gradient(90deg, #FF6B6B, #4ECDC4);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    z-index: 1;
    letter-spacing: 0.5px;
}

.view-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #4ECDC4, #FF6B6B);
    z-index: -1;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.view-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.view-btn:hover::before {
    opacity: 1;
}

.view-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(25, 42, 86, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    overflow-y: auto;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    margin: 5% auto;
    padding: 2.5rem;
    width: 85%;
    max-width: 950px;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: modalFadeIn 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 8px;
    background: linear-gradient(90deg, #FF6B6B, #4ECDC4);
}

.modal-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.05) 0%, rgba(78, 205, 196, 0.05) 100%);
    z-index: -1;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-70px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 2rem;
    color: #7f8c8d;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.close-btn:hover {
    color: #e74c3c;
    background: rgba(255, 255, 255, 0.9);
    transform: rotate(90deg);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Places Styles */
.places-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.8rem;
    margin-top: 2rem;
}

.place-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: placeCardAppear 0.5s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
    animation-fill-mode: both;
}

@keyframes placeCardAppear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.place-card:nth-child(3n+1) {
    animation-delay: 0.1s;
}

.place-card:nth-child(3n+2) {
    animation-delay: 0.2s;
}

.place-card:nth-child(3n+3) {
    animation-delay: 0.3s;
}

.place-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #4ECDC4, #556270);
}

.place-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.place-name {
    font-size: 1.3rem;
    margin-bottom: 1.2rem;
    color: #2c3e50;
    font-weight: 600;
    position: relative;
    display: inline-block;
    padding-bottom: 8px;
}

.place-name::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 2px;
    background: linear-gradient(90deg, #4ECDC4, #556270);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.place-card:hover .place-name::after {
    width: 50px;
}

.view-events-btn {
    background: linear-gradient(90deg, #4ECDC4, #556270);
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    z-index: 1;
    letter-spacing: 0.5px;
}

.view-events-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #556270, #4ECDC4);
    z-index: -1;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.view-events-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.view-events-btn:hover::before {
    opacity: 1;
}

.view-events-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Events Styles */
.events-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.8rem;
    margin-top: 2rem;
}

.event-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: eventCardAppear 0.5s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
    animation-fill-mode: both;
}

@keyframes eventCardAppear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.event-card:nth-child(4n+1) {
    animation-delay: 0.1s;
}

.event-card:nth-child(4n+2) {
    animation-delay: 0.2s;
}

.event-card:nth-child(4n+3) {
    animation-delay: 0.3s;
}

.event-card:nth-child(4n+4) {
    animation-delay: 0.4s;
}

.event-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #9D50BB, #6E48AA);
}

.event-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.event-name {
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
    color: #2c3e50;
    font-weight: 600;
    position: relative;
    display: inline-block;
    padding-bottom: 8px;
}

.event-name::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 2px;
    background: linear-gradient(90deg, #9D50BB, #6E48AA);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.event-card:hover .event-name::after {
    width: 50px;
}

.event-date {
    font-size: 0.95rem;
    color: #7f8c8d;
    margin-bottom: 1.2rem;
    position: relative;
    display: inline-block;
    padding: 5px 12px;
    background: rgba(157, 80, 187, 0.1);
    border-radius: 20px;
}

.view-images-btn {
    background: linear-gradient(90deg, #9D50BB, #6E48AA);
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    z-index: 1;
    letter-spacing: 0.5px;
}

.view-images-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #6E48AA, #9D50BB);
    z-index: -1;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.view-images-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.view-images-btn:hover::before {
    opacity: 1;
}

.view-images-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Gallery Styles */
.gallery-modal-content {
    width: 92%;
    max-width: 1300px;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.97);
}

.gallery-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 2rem;
    animation: galleryFadeIn 0.6s ease-out;
}

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

.main-image-container {
    width: 100%;
    height: 550px;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    position: relative;
    background: #000;
    transition: all 0.4s ease;
}

.main-image-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0) 20%, rgba(0,0,0,0) 80%, rgba(0,0,0,0.2) 100%);
    z-index: 1;
    pointer-events: none;
}

#main-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    animation: imageAppear 0.5s ease-out;
}

@keyframes imageAppear {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.main-image-container:hover #main-image {
    transform: scale(1.02);
}

.thumbnails-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    justify-content: center;
    padding: 1rem 0;
}

.thumbnail {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    position: relative;
    transform: translateY(0) scale(1);
    opacity: 0;
    animation: thumbAppear 0.5s ease-out forwards;
    animation-fill-mode: both;
}

@keyframes thumbAppear {
    to { opacity: 1; transform: translateY(0); }
}

.thumbnail:nth-child(5n+1) { animation-delay: 0.1s; }
.thumbnail:nth-child(5n+2) { animation-delay: 0.2s; }
.thumbnail:nth-child(5n+3) { animation-delay: 0.3s; }
.thumbnail:nth-child(5n+4) { animation-delay: 0.4s; }
.thumbnail:nth-child(5n+5) { animation-delay: 0.5s; }

.thumbnail::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.thumbnail:hover {
    transform: translateY(-8px) scale(1.08);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.2);
}

.thumbnail:hover::before {
    opacity: 1;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.thumbnail:hover img {
    transform: scale(1.1);
}

.thumbnail.active {
    border: 3px solid #9D50BB;
    box-shadow: 0 0 0 3px rgba(157, 80, 187, 0.3), 0 12px 25px rgba(0, 0, 0, 0.2);
    transform: translateY(-8px) scale(1.08);
}

.thumbnail.active::before {
    background: rgba(157, 80, 187, 0.2);
    opacity: 1;
}

/* Loading and Error Styles */
.loading, .error {
    text-align: center;
    padding: 3rem 2rem;
    width: 100%;
    font-size: 1.3rem;
    border-radius: 16px;
    margin: 1rem 0;
    animation: fadeIn 0.5s ease-out;
}

.loading {
    color: #4ECDC4;
    position: relative;
    background: linear-gradient(135deg, rgba(78, 205, 196, 0.05) 0%, rgba(78, 205, 196, 0.1) 100%);
    border: 1px solid rgba(78, 205, 196, 0.2);
}

.loading:before {
    content: "Loading...";
    display: block;
    margin-bottom: 1.5rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: #4ECDC4;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.loading:after {
    content: "";
    display: block;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 4px solid transparent;
    border-top-color: #4ECDC4;
    border-bottom-color: #FF6B6B;
    margin: 1rem auto;
    animation: spin 1.2s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
    box-shadow: 0 0 15px rgba(78, 205, 196, 0.3);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    50% { transform: rotate(180deg); border-width: 6px; }
    100% { transform: rotate(360deg); }
}

.error {
    color: #FF6B6B;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.05) 0%, rgba(255, 107, 107, 0.1) 100%);
    border: 1px solid rgba(255, 107, 107, 0.2);
    border-radius: 16px;
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.1);
    position: relative;
    overflow: hidden;
}

.error:before {
    content: '\f071';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 1.5rem;
    display: block;
    margin-bottom: 1rem;
    color: #FF6B6B;
}

.error:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #FF6B6B, transparent);
}

/* Responsive Styles */
@media (max-width: 768px) {
    .districts-container,
    .places-container,
    .events-container {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }

    .main-image-container {
        height: 350px;
    }

    .thumbnail {
        width: 80px;
        height: 80px;
    }
}

@media (max-width: 480px) {
    .districts-container,
    .places-container,
    .events-container {
        grid-template-columns: 1fr;
    }

    header h1 {
        font-size: 2rem;
    }

    .main-image-container {
        height: 250px;
    }

    .thumbnail {
        width: 60px;
        height: 60px;
    }
}