/* =====================================================
   RESIDENCE STELLA ALPINA - CUSTOM OVERRIDES
   Template: Mountain Hotel by CAPPA
   ===================================================== */

/* =====================================================
   0. LOGO STYLING
   ===================================================== */
.logo-wrapper {
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
}

.logo-wrapper .logo-img {
    max-height: 50px;
    width: auto;
}

.nav-scroll .logo-wrapper {
    background: rgba(255, 255, 255, 0.95);
}

/* =====================================================
   1. LANGUAGE SWITCHER
   ===================================================== */
.lang-switcher {
    display: flex;
    gap: 5px;
    align-items: center;
}

.lang-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    border-color: #91765a;
    color: #91765a;
}

.lang-btn.active {
    background: #91765a;
    border-color: #91765a;
    color: #fff;
}

/* When navbar is scrolled */
.navbar.scrolled .lang-btn {
    border-color: rgba(0, 0, 0, 0.2);
    color: #14100c;
}

.navbar.scrolled .lang-btn:hover,
.navbar.scrolled .lang-btn.active {
    background: #91765a;
    border-color: #91765a;
    color: #fff;
}

/* =====================================================
   2. HERO ENHANCEMENTS
   ===================================================== */
.hero-tagline {
    font-size: 1.2rem;
    margin-top: 15px;
    opacity: 0.9;
    max-width: 500px;
}

/* =====================================================
   3. GALLERY SECTION - Modern Design
   ===================================================== */
.gallery-section {
    background: linear-gradient(180deg, #f5eee7 0%, #ebe4da 100%);
    padding-bottom: 60px;
}

/* Gallery Filters - Elegant Pills */
.gallery-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
    padding: 0 15px;
}

.filter-btn {
    padding: 12px 28px;
    border: 2px solid #91765a;
    background: transparent;
    color: #91765a;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-radius: 30px;
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.filter-btn:hover::before {
    left: 100%;
}

.filter-btn:hover,
.filter-btn.active {
    background: linear-gradient(135deg, #91765a 0%, #a68966 100%);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(145, 118, 90, 0.35);
}

.filter-btn.active {
    transform: translateY(0);
}

/* Gallery Grid - Masonry-like */
#gallery-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 0 15px;
}

@media (max-width: 1200px) {
    #gallery-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;
    }
}

@media (max-width: 768px) {
    #gallery-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 480px) {
    #gallery-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Gallery Items - Lazy Loading Version */
.gallery-item-lazy {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, #e8dcc3 0%, #d4c4a8 100%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.gallery-item-lazy:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.gallery-item-lazy img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.4s ease;
    opacity: 0;
}

.gallery-item-lazy img.loaded {
    opacity: 1;
}

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

/* Overlay on hover */
.gallery-item-lazy::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        transparent 40%,
        rgba(0, 0, 0, 0.7) 100%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
    border-radius: 12px;
}

.gallery-item-lazy:hover::before {
    opacity: 1;
}

/* Zoom icon on hover */
.gallery-item-lazy::after {
    content: '\f00e'; /* FontAwesome search-plus */
    font-family: 'Font Awesome 5 Pro', 'Font Awesome 5 Free', FontAwesome;
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    z-index: 3;
    color: #fff;
    font-size: 28px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(145, 118, 90, 0.9);
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.gallery-item-lazy:hover::after {
    transform: translate(-50%, -50%) scale(1);
}

/* Caption styling */
.gallery-item-lazy .gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 15px 15px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    z-index: 2;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    line-height: 1.4;
}

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

/* Loading skeleton animation */
.gallery-item-lazy.loading {
    background: linear-gradient(
        90deg,
        #e8dcc3 0%,
        #f0e6d6 20%,
        #e8dcc3 40%,
        #e8dcc3 100%
    );
    background-size: 200% 100%;
    animation: galleryShimmer 1.5s ease-in-out infinite;
}

.gallery-item-lazy.loading::before,
.gallery-item-lazy.loading::after {
    display: none;
}

@keyframes galleryShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Fade in animation for loaded images */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(1.05); }
    to { opacity: 1; transform: scale(1); }
}

/* Legacy gallery-item support */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    aspect-ratio: 4/3;
}

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

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

/* Gallery Pagination - Modern */
#gallery-pagination {
    margin-top: 50px;
    text-align: center;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 12px 24px;
    border: 2px solid #91765a;
    background: transparent;
    color: #91765a;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 25px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pagination-btn:hover {
    background: #91765a;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(145, 118, 90, 0.3);
}

.pagination-numbers {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pagination-number {
    width: 42px;
    height: 42px;
    border: 2px solid #91765a;
    background: transparent;
    color: #91765a;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-number:hover {
    background: #91765a;
    color: #fff;
    transform: scale(1.1);
}

.pagination-number.active {
    background: linear-gradient(135deg, #91765a 0%, #a68966 100%);
    color: #fff;
    border-color: #91765a;
    box-shadow: 0 4px 15px rgba(145, 118, 90, 0.4);
}

.pagination-ellipsis {
    color: #91765a;
    font-size: 16px;
    padding: 0 5px;
}

.pagination-info {
    margin-top: 20px;
    color: #91765a;
    font-size: 14px;
    opacity: 0.8;
}

@media (max-width: 576px) {
    .pagination-controls {
        gap: 10px;
    }

    .pagination-btn {
        padding: 10px 18px;
        font-size: 12px;
    }

    .pagination-number {
        width: 36px;
        height: 36px;
        font-size: 12px;
    }
}

/* =====================================================
   4. LIGHTBOX
   ===================================================== */
.lightbox-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 99999;
    justify-content: center;
    align-items: center;
}

.lightbox-modal.active {
    display: flex;
}

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

.lightbox-image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
}

.lightbox-caption {
    text-align: center;
    color: #fff;
    padding: 15px;
    font-size: 16px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: #fff;
    cursor: pointer;
    z-index: 100000;
    transition: color 0.3s ease;
}

.lightbox-close:hover {
    color: #91765a;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(145, 118, 90, 0.8);
    border: none;
    color: #fff;
    font-size: 24px;
    padding: 15px 20px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: #91765a;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* =====================================================
   5. CONTACT SECTION ENHANCEMENTS
   ===================================================== */
.contact-info {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.08);
}

.contact-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 25px;
}

.contact-item:last-child {
    margin-bottom: 0;
}

.contact-item .icon {
    width: 50px;
    height: 50px;
    background: #91765a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    flex-shrink: 0;
}

.contact-item .icon i,
.contact-item .icon span {
    color: #fff;
    font-size: 20px;
}

.contact-item .text h5 {
    margin-bottom: 5px;
    font-size: 16px;
    font-weight: 600;
}

.contact-item .text p {
    margin: 0;
    color: #625c56;
    font-size: 15px;
}

.contact-item .text a {
    color: #91765a;
}

/* Contact Form */
.contact-form {
    background: #fff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.08);
}

.contact-form .form-group {
    position: relative;
    margin-bottom: 25px;
}

.contact-form .form-control {
    width: 100%;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    font-size: 15px;
    transition: border-color 0.3s ease;
    background: #f9f9f9;
}

.contact-form .form-control:focus {
    border-color: #91765a;
    outline: none;
    background: #fff;
}

.contact-form label {
    position: absolute;
    left: 15px;
    top: 15px;
    color: #999;
    font-size: 14px;
    transition: all 0.3s ease;
    pointer-events: none;
}

.contact-form .form-control:focus + label,
.contact-form .form-control:not(:placeholder-shown) + label {
    top: -10px;
    left: 10px;
    font-size: 12px;
    background: #fff;
    padding: 0 5px;
    color: #91765a;
}

.contact-form .date-label,
.contact-form .select-label {
    top: -10px;
    left: 10px;
    font-size: 12px;
    background: #fff;
    padding: 0 5px;
    color: #91765a;
}

.contact-form textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.contact-form .form-check {
    display: flex;
    align-items: flex-start;
}

.contact-form .form-check-input {
    margin-right: 10px;
    margin-top: 3px;
}

.contact-form .form-check-label {
    position: static;
    color: #625c56;
    font-size: 14px;
}

.contact-form .form-check-label a {
    color: #91765a;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quick-actions .butn-dark,
.quick-actions .butn-light {
    text-align: center;
}

/* =====================================================
   6. SERVICE ICONS
   ===================================================== */
.service-icon {
    margin-bottom: 15px;
}

.service-icon i {
    font-size: 40px;
    color: #91765a;
}

/* =====================================================
   7. ROOM DETAILS
   ===================================================== */
.room-details {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 15px;
}

/* =====================================================
   8. MAP CONTAINER
   ===================================================== */
.map-container {
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.1);
}

/* =====================================================
   9. FOOTER ENHANCEMENTS
   ===================================================== */
.footer-logos {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.footer-logos img {
    display: block;
    margin: 0 auto;
}

.footer-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.footer-rating .star-rating {
    color: #91765a;
}

/* =====================================================
   10. RESPONSIVE ADJUSTMENTS
   ===================================================== */
@media (max-width: 991px) {
    .lang-switcher {
        margin-top: 20px;
        justify-content: center;
    }

    .contact-info {
        margin-bottom: 30px;
    }

    .contact-form {
        padding: 25px;
    }
}

@media (max-width: 767px) {
    .gallery-filters {
        gap: 5px;
    }

    .filter-btn {
        padding: 8px 15px;
        font-size: 12px;
    }

    .lightbox-prev,
    .lightbox-next {
        padding: 10px 15px;
        font-size: 18px;
    }

    .contact-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .contact-item .icon {
        margin-right: 0;
        margin-bottom: 15px;
    }
}

/* =====================================================
   11. ANIMATIONS
   ===================================================== */
.gallery-item {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s ease forwards;
}

.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.15s; }
.gallery-item:nth-child(3) { animation-delay: 0.2s; }
.gallery-item:nth-child(4) { animation-delay: 0.25s; }
.gallery-item:nth-child(5) { animation-delay: 0.3s; }
.gallery-item:nth-child(6) { animation-delay: 0.35s; }
.gallery-item:nth-child(7) { animation-delay: 0.4s; }
.gallery-item:nth-child(8) { animation-delay: 0.45s; }
.gallery-item:nth-child(9) { animation-delay: 0.5s; }
.gallery-item:nth-child(10) { animation-delay: 0.55s; }
.gallery-item:nth-child(11) { animation-delay: 0.6s; }
.gallery-item:nth-child(12) { animation-delay: 0.65s; }

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

/* =====================================================
   12. UTILITIES
   ===================================================== */
.white {
    color: #fff !important;
}

.mt-60 {
    margin-top: 60px;
}

/* Fix for section title in dark backgrounds */
.section-title.white span {
    color: #fff;
}

/* =====================================================
   13. BOTTONE SUBMIT ELEGANTE
   ===================================================== */
.btn-submit-elegant {
    position: relative;
    padding: 1rem 2.5rem;
    background: transparent;
    color: #91765a;
    border: 1px solid #91765a;
    border-radius: 4px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1;
}

/* Fill animato da sinistra */
.btn-submit-elegant::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: #91765a;
    transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: -1;
}

/* Hover: fill + lift + cambio colore testo */
.btn-submit-elegant:hover {
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(145, 118, 90, 0.35);
}

.btn-submit-elegant:hover::before {
    width: 100%;
}

/* Focus state (accessibilità) */
.btn-submit-elegant:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(145, 118, 90, 0.4);
}

/* Active: click feedback */
.btn-submit-elegant:active {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(145, 118, 90, 0.3);
}

/* Shimmer effect */
.btn-submit-elegant::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.6s ease;
    z-index: 2;
    pointer-events: none;
}

.btn-submit-elegant:hover::after {
    left: 100%;
}

/* Loading state */
.btn-submit-elegant.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-submit-elegant .btn-loading {
    display: none;
}

.btn-submit-elegant.loading .btn-text {
    opacity: 0;
}

.btn-submit-elegant.loading .btn-loading {
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: spinBtn 1s linear infinite;
    color: #91765a;
}

@keyframes spinBtn {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}
