/* Gallery specific styles */
.gallery-container {
    position: relative;
    overflow: hidden;
    padding: 2rem 0;
}

.gallery-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease-out;
    max-width: 1000px;
    margin: 0 auto;
}

.gallery-wrapper.visible {
    opacity: 1;
    transform: translateY(0);
}

.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.4s ease;
    width: 100%;
    margin: 0 auto;
}

.gallery-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 255, 255, 0.15);
}

.gallery-item-image {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
}

.gallery-item.wide .gallery-item-image {
    width: 100%;
}

.gallery-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: all 0.4s ease;
}

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

.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.7));
    color: #fff;
    transform: translateY(100%);
    transition: all 0.4s ease;
    cursor: pointer;
}

.gallery-item-overlay .read-more {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.5rem 1.5rem;
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 20px;
    color: #0ff;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    z-index: 10;
}

.gallery-item-full-description {
    display: none;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.gallery-item-full-description.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.gallery-item-overlay.expanded {
    transform: translateY(0) !important;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.8));
    height: auto;
    max-height: 80%;
    overflow-y: auto;
}

.gallery-item-overlay .read-more:hover {
    background: rgba(0, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Description popup styles */
.description-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid rgba(0, 255, 255, 0.1);
    border-radius: 15px;
    padding: 2rem;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 2100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.description-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.description-popup-content {
    color: #fff;
}

.description-popup-title {
    font-size: 1.8rem;
    color: #0ff;
    margin-bottom: 1rem;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.description-popup-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #e0e0e0;
    margin-bottom: 1.5rem;
}

.description-popup-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.description-popup-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.gallery-item:hover .gallery-item-overlay {
    transform: translateY(0);
}

.gallery-item-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #0ff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.gallery-item-description {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Lightbox styles */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
}

.lightbox-nav button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lightbox-nav button:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Popup styles for Read More */
.read-more-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 12px;
    padding: 2rem;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 255, 255, 0.3) rgba(0, 0, 0, 0.1);
}

.read-more-popup .scroll-top {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    visibility: hidden;
    z-index: 2001;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.1),
        inset 1px 1px 1px rgba(255, 255, 255, 0.2);
}

.read-more-popup .scroll-top.visible {
    opacity: 1;
    visibility: visible;
    animation: fadeInUp 0.6s ease forwards;
}

.read-more-popup .scroll-top:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.15),
        inset 1px 1px 1px rgba(255, 255, 255, 0.3);
    animation: bounce 0.8s ease infinite;
}

.read-more-popup .scroll-top::before {
    content: '↑';
    font-size: 1.5rem;
    font-weight: bold;
    background: linear-gradient(to bottom, #333, #666);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 1px 2px rgba(255,255,255,0.1);
}

.read-more-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.read-more-popup .popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.read-more-popup .popup-title {
    font-size: 1.5rem;
    color: #0ff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.read-more-popup .popup-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    color: #333;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.read-more-popup .popup-close:hover {
    background: #fff;
    transform: rotate(90deg);
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}

.read-more-popup .popup-content {
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    position: relative;
}

.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.1),
        inset 1px 1px 1px rgba(255, 255, 255, 0.2);
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    animation: fadeInUp 0.6s ease forwards;
}

.scroll-to-top:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.15),
        inset 1px 1px 1px rgba(255, 255, 255, 0.3);
    animation: bounce 0.8s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(-8px); }
    50% { transform: translateY(-12px); }
}

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

.scroll-to-top::before {
    content: '▲';
    font-size: 20px;
    color: #000;
    font-weight: bold;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
}

.read-less, .popup-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  color: #333;
  border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}
.read-less:hover, .popup-close:hover {
  background: #eee;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}

@media (max-width: 768px) {
    .gallery-wrapper {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
    }

    .gallery-item img {
        height: 250px;
    }

    .lightbox-content {
        max-width: 95%;
    }
}