/**
 * Star Inn Suites & Retreat - Component Styles
 *
 * This file contains styles for all reusable components including
 * navigation, buttons, cards, sections, forms, and more.
 */

/* ===== Preloader ===== */
#preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--navy-950);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease;
}

#preloader.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader-logo {
    width: 180px;
    margin: 0 auto;
    animation: pulse 1.5s ease-in-out infinite;
    margin-bottom: 1.5rem;
}

.loader-bar {
    width: 150px;
    height: 3px;
    background: var(--navy-800);
    border-radius: 3px;
    overflow: hidden;
    margin: 0 auto;
}

.loader-bar-fill {
    height: 100%;
    width: 30%;
    background: var(--gradient-gold);
    border-radius: 3px;
    animation: shimmer 1s ease-in-out infinite;
}

/* ===== Top Header ===== */
.top-header {
    background: linear-gradient(90deg, var(--brand-blue), var(--navy-900));
    padding: 0.5rem 0;
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(212, 169, 50, 0.2);
}

.top-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.top-header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.top-header-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: rgba(255,255,255,0.8);
}

.top-header-item i {
    color: var(--gold-500);
    font-size: 0.75rem;
}

.top-header-item a:hover {
    color: var(--gold-400);
}

.top-header-social {
    display: flex;
    gap: 0.75rem;
}

.top-header-social a {
    color: rgba(255,255,255,0.7);
    transition: color 0.3s;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
}

.top-header-social a:hover {
    color: var(--gold-400);
    background: rgba(212, 169, 50, 0.2);
}

@media (max-width: 768px) {
    .top-header {
        display: none;
    }
}

/* ===== Navigation ===== */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: all 0.4s ease;
    overflow: visible;
}

#navbar .container {
    overflow: visible;
}

#navbar.has-top-header {
    top: 40px;
}

#navbar.scrolled {
    top: 0 !important;
}

.nav-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(7,13,21,0.98), rgba(7,13,21,0.9));
    backdrop-filter: blur(20px);
    opacity: 0;
    transition: opacity 0.4s;
}

#navbar.scrolled .nav-bg {
    opacity: 1;
}

.nav-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    transition: height 0.3s;
    overflow: visible;
}

#navbar.scrolled .nav-container {
    height: 70px;
}

.nav-logo img {
    height: 85px;
    transition: height 0.3s;
}

#navbar.scrolled .nav-logo img {
    height: 72px;
}

.nav-menu {
    display: none;
    align-items: center;
    gap: 0.25rem;
}

@media (min-width: 1024px) {
    .nav-menu {
        display: flex;
    }
}

.nav-link {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255,255,255,0.9);
    position: relative;
    transition: color 0.3s;
}

.nav-link.active {
    color: var(--gold-400);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--gradient-gold);
    transition: all 0.3s;
    transform: translateX(-50%);
}

.nav-link:hover {
    color: var(--gold-400);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 60%;
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.nav-dropdown-toggle i {
    font-size: 0.7rem;
    transition: transform 0.3s;
}

.nav-dropdown:hover .nav-dropdown-toggle i {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 250px;
    max-height: 75vh;
    overflow-y: auto;
    background: var(--navy-900);
    border: 1px solid rgba(212, 169, 50, 0.2);
    border-radius: 0.5rem;
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    scrollbar-width: thin;
    scrollbar-color: var(--gold-500) var(--navy-900);
    z-index: 1001;
}

.nav-dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.nav-dropdown-menu::-webkit-scrollbar-track {
    background: var(--navy-900);
}

.nav-dropdown-menu::-webkit-scrollbar-thumb {
    background: var(--gold-500);
    border-radius: 10px;
}

.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1.25rem;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.8);
    transition: all 0.3s;
}

.dropdown-link:hover {
    background: rgba(212, 169, 50, 0.1);
    color: var(--gold-400);
    padding-left: 1.5rem;
}

/* ===== Nested Dropdown Styles (Tree) ===== */
.dropdown-item-group {
    position: relative;
}

.dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    transition: all 0.3s;
}

.dropdown-header:hover {
    background: rgba(212, 169, 50, 0.1);
}

.dropdown-link-text {
    flex-grow: 1;
    padding: 0.6rem 0 0.6rem 1.25rem;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.8);
    display: block;
}

.dropdown-link-text:hover {
    color: var(--gold-400);
}

.dropdown-toggle {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    padding: 0.6rem 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropdown-toggle:hover {
    color: var(--gold-400);
}

.dropdown-toggle i {
    font-size: 0.7rem;
    transition: transform 0.3s;
}

.dropdown-item-group.is-open > .dropdown-header .dropdown-toggle i {
    transform: rotate(90deg);
    color: var(--gold-400);
}

.dropdown-submenu {
    position: static;
    display: none;
    padding-left: 0.5rem;
    background: rgba(0, 0, 0, 0.15);
    border-left: 1px solid rgba(212, 169, 50, 0.1);
    margin-left: 1rem;
}

.dropdown-item-group.is-open > .dropdown-submenu {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 0.4rem;
    transition: all 0.3s;
}

.btn-gold {
    background: var(--gradient-gold);
    color: var(--navy-950);
    box-shadow: 0 4px 15px rgba(212, 169, 50, 0.3);
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 169, 50, 0.4);
}

.btn-outline {
    border: 1px solid var(--gold-500);
    color: var(--gold-400);
}

.btn-outline:hover {
    background: var(--gold-500);
    color: var(--navy-950);
}

.btn-brand {
    background: var(--gradient-brand);
    color: #fff;
    box-shadow: 0 4px 15px rgba(30, 75, 142, 0.3);
}

.btn-brand:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(30, 75, 142, 0.4);
}

/* ===== Mobile Navigation ===== */
.mobile-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 0.5rem;
}

.mobile-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    transition: all 0.3s;
}

.mobile-toggle:hover span {
    background: var(--gold-400);
}

@media (min-width: 1024px) {
    .mobile-toggle {
        display: none;
    }
}

#mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(7,13,21,0.98);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Changed from center */
    padding: 2rem;
    gap: 0;
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.4,0,0.2,1);
    overflow-y: auto;
}

#mobile-menu.open {
    transform: translateX(0);
}

.mobile-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    z-index: 201;
}

.mobile-close:hover {
    color: var(--gold-400);
}

.mobile-link {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem; /* Reduced slightly */
    color: #fff;
    display: block;
    padding: 0.75rem 0;
    width: 100%;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.mobile-link:hover,
.mobile-link.active {
    color: var(--gold-400);
}

/* Mobile Dropdown Styles */
.mobile-dropdown {
    width: 100%;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.mobile-link-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-link-group .mobile-link {
    border-bottom: none;
    flex-grow: 1;
}

.mobile-dropdown-toggle {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.5);
    font-size: 0.9rem;
    transition: all 0.3s;
}

.mobile-dropdown-toggle.active {
    color: var(--gold-500);
    transform: rotate(180deg);
}

.mobile-dropdown-menu {
    display: none;
    padding-left: 1rem;
    padding-bottom: 0.5rem;
    background: rgba(0,0,0,0.2);
    border-left: 2px solid rgba(212, 169, 50, 0.2);
}

.mobile-dropdown-menu.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Override recursive styles for mobile */
.mobile-dropdown-menu .dropdown-link-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    padding: 0.75rem 0;
    color: rgba(255,255,255,0.8);
}

.mobile-dropdown-menu .dropdown-header:hover {
    background: transparent;
}

.mobile-dropdown-menu .dropdown-toggle {
    padding: 0.75rem;
}

/* ===== Hero Section ===== */
#hero {
    position: relative;
    height: 100vh;
    min-height: 700px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-media {
    position: absolute;
    inset: 0;
}

.hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-slider {
    position: absolute;
    inset: 0;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    background-size: cover;
    background-position: center;
    transition: opacity 1.5s ease;
}

.hero-slide.active {
    opacity: 1;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(7,13,21,0.7) 0%, rgba(7,13,21,0.5) 50%, rgba(7,13,21,0.7) 100%);
}

.hero-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(212, 169, 50, 0.05) 0%, transparent 50%);
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.5rem;
    margin-bottom: 1.5rem;
    background: rgba(212, 169, 50, 0.15);
    border: 1px solid rgba(212, 169, 50, 0.4);
    border-radius: 3rem;
    animation: slideUp 0.8s ease 0.2s both;
}

.hero-badge i {
    color: var(--gold-500);
}

.hero-badge span {
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    color: var(--gold-300);
    text-transform: uppercase;
}

.hero-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(2.5rem, 7vw, 5rem);
    font-weight: 400;
    line-height: 1.15;
    margin-bottom: 1.5rem;
    animation: slideUp 0.8s ease 0.4s both;
}

.hero-title span {
    font-weight: 600;
    font-style: italic;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: rgba(255,255,255,0.8);
    font-weight: 300;
    max-width: 650px;
    margin: 0 auto 2.5rem;
    animation: slideUp 0.8s ease 0.6s both;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    animation: slideUp 0.8s ease 0.8s both;
}

.hero-btn {
    padding: 1rem 2rem;
    font-size: 0.9rem;
}

.hero-decor {
    position: absolute;
    border: 1px solid rgba(212, 169, 50, 0.3);
    border-radius: 50%;
    animation: float 5s ease-in-out infinite;
}

.hero-decor-1 {
    top: 15%;
    left: 5%;
    width: 100px;
    height: 100px;
}

.hero-decor-2 {
    bottom: 20%;
    right: 8%;
    width: 80px;
    height: 80px;
    animation-delay: -2s;
}

.hero-slider-dots {
    position: absolute;
    bottom: 8rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.75rem;
    z-index: 20;
}

.slider-dot {
    width: 40px;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s;
}

.slider-dot.active {
    width: 60px;
}

.slider-dot-fill {
    height: 100%;
    width: 0;
    background: var(--gold-500);
}

.slider-dot.active .slider-dot-fill {
    animation: progress 6s linear forwards;
}

.scroll-indicator {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    z-index: 20;
}

.scroll-indicator span {
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
}

.scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(180deg, var(--gold-500), transparent);
    animation: float 1.5s ease-in-out infinite;
}

/* ===== Stats Section ===== */
.stats-section {
    position: relative;
    padding: 3rem 0;
    background: linear-gradient(90deg, var(--navy-900), var(--brand-blue), var(--navy-900));
}

.stats-section::before,
.stats-section::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-500), transparent);
}

.stats-section::before {
    top: 0;
}

.stats-section::after {
    bottom: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 600;
    color: var(--gold-400);
}

.stat-label {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.8);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-top: 0.25rem;
}

/* ===== Sections ===== */
.section {
    position: relative;
    padding: 5rem 0;
    overflow: hidden;
}

.section-dark {
    background: var(--navy-950);
}

.section-alt {
    background: var(--navy-900);
}

.section-white {
    background: #fff;
    color: var(--navy-950);
}

.section-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23d4a932' fill-opacity='1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1;
}

.section .container {
    position: relative;
    z-index: 2;
}


.section-header {
    text-align: center;
    margin-bottom: 3.5rem;
    position: relative;
}

.section-label {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--gold-500);
    margin-bottom: 0.75rem;
}

.section-label::before,
.section-label::after {
    content: '';
    width: 30px;
    height: 1px;
    background: var(--gold-500);
}

.section-label::before {
    display: block;
}

.section-label::after {
    display: block;
}

.section-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 400;
    margin-bottom: 1rem;
}

.section-title span {
    font-style: italic;
    font-weight: 600;
}

.section-desc {
    color: rgba(255,255,255,0.7);
    max-width: 600px;
    margin: 0 auto;
}

.section-header-row {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

@media (min-width: 768px) {
    .section-header-row {
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
    }
}

.section-header-left .section-label {
    justify-content: flex-start;
}

.section-header-left .section-label::before {
    display: none;
}

.section-header-left .section-title {
    text-align: left;
    margin-bottom: 0;
}

.section-nav {
    display: flex;
    gap: 0.75rem;
}

.nav-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--gold-500);
    color: var(--gold-500);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.nav-btn:hover {
    background: var(--gold-500);
    color: var(--navy-950);
}

/* ===== Back to Top Button ===== */
#back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 50;
    width: 50px;
    height: 50px;
    border-radius: 0.75rem;
    background: var(--gradient-gold);
    color: var(--navy-950);
    box-shadow: 0 10px 30px rgba(212, 169, 50, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(1rem);
    transition: all 0.3s;
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#back-to-top:hover {
    transform: translateY(-4px);
}

/* ===== CTA Banner ===== */
.cta-banner {
    background: var(--navy-900);
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.cta-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(30, 75, 142, 0.1) 0%, transparent 50%), radial-gradient(circle at 70% 50%, rgba(224, 90, 109, 0.1) 0%, transparent 50%);
}

.cta-card {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    background: linear-gradient(135deg, rgba(212, 169, 50, 0.08) 0%, rgba(26, 42, 66, 0.8) 50%, rgba(212, 169, 50, 0.08) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(212, 169, 50, 0.3);
    border-radius: 1.5rem;
    padding: 3rem 2rem;
    text-align: center;
}

.cta-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 80px;
    height: 80px;
    border-top: 3px solid var(--gold-500);
    border-left: 3px solid var(--gold-500);
    border-radius: 1.5rem 0 0 0;
}

.cta-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 80px;
    height: 80px;
    border-bottom: 3px solid var(--gold-500);
    border-right: 3px solid var(--gold-500);
    border-radius: 0 0 1.5rem 0;
}

.cta-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    color: #fff;
    margin-bottom: 1rem;
}

.cta-description {
    color: rgba(255, 255, 255, 0.7);
    max-width: 600px;
    margin: 0 auto 2rem;
}

.cta-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

@media (min-width: 640px) {
    .cta-buttons {
        flex-direction: row;
        justify-content: center;
    }
}

/* ===== Forms ===== */
.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.75rem;
    color: var(--gold-400);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(7, 13, 21, 0.5);
    border: 1px solid rgba(212, 169, 50, 0.2);
    border-radius: 0.5rem;
    color: #fff;
    transition: all 0.3s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--gold-500);
    box-shadow: 0 0 0 3px rgba(212, 169, 50, 0.1);
}

.form-textarea {
    resize: none;
    min-height: 120px;
}