/* ===========================================
   Đông Triều 360 - Virtual Tour Website Styles
   =========================================== */

:root {
    /* Colors - Traditional Vietnamese */
    --primary: #8B0000;
    --primary-light: #B22222;
    --primary-dark: #5c0000;
    --accent: #D4AF37;
    --accent-light: #FFD700;

    /* Neutrals */
    --bg-dark: #0a0a0a;
    --bg-darker: #050505;
    --sidebar-bg: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
    --text-light: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.7);
    --text-subtle: rgba(255, 255, 255, 0.5);

    /* Sidebar */
    --sidebar-width: 320px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;

    /* Shadows */
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(139, 0, 0, 0.3);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-light);
    min-height: 100%;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ===========================================
   TOUR PAGE
   =========================================== */

.tour-page {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Mobile Header */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(10, 10, 10, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    padding: 0 1rem;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
}

.menu-toggle {
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hamburger {
    position: relative;
    width: 24px;
    height: 2px;
    background: var(--text-light);
    transition: var(--transition-fast);
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background: var(--text-light);
    transition: var(--transition-fast);
}

.hamburger::before { top: -7px; }
.hamburger::after { bottom: -7px; }

.menu-toggle.active .hamburger {
    background: transparent;
}

.menu-toggle.active .hamburger::before {
    top: 0;
    transform: rotate(45deg);
}

.menu-toggle.active .hamburger::after {
    bottom: 0;
    transform: rotate(-45deg);
}

.mobile-title {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-light);
}

.home-link {
    font-size: 1.5rem;
    text-decoration: none;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid rgba(212, 175, 55, 0.15);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
    background: linear-gradient(180deg, rgba(139,0,0,0.1) 0%, transparent 100%);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-light);
}

.logo-icon {
    font-size: 2rem;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-light);
}

.logo-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Tour Navigation */
.tour-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.nav-heading {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
}

.tour-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.tour-item {
    border-radius: 8px;
    overflow: hidden;
}

.tour-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-fast);
    border-radius: 8px;
}

.tour-btn:hover {
    background: rgba(139, 0, 0, 0.15);
    color: var(--text-light);
}

.tour-btn.active {
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.3) 0%, rgba(139, 0, 0, 0.15) 100%);
    color: var(--accent-light);
    border-left: 3px solid var(--primary-light);
}

.tour-btn-number {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(212, 175, 55, 0.15);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
    color: var(--accent);
}

.tour-btn.active .tour-btn-number {
    background: var(--primary);
    color: var(--text-light);
}

.tour-btn-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(212, 175, 55, 0.15);
    background: linear-gradient(0deg, rgba(139,0,0,0.1) 0%, transparent 100%);
}

.sidebar-footer .footer-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-subtle);
    font-weight: 500;
}

.footer-icon {
    font-size: 1rem;
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999;
}

/* Main Content */
.main-content {
    flex: 1;
    position: relative;
    background: var(--bg-darker);
}

.viewer-container {
    position: absolute;
    inset: 0;
}

.tour-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: var(--bg-darker);
}

/* Loading State */
.viewer-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: var(--bg-darker);
    z-index: 10;
    transition: opacity var(--transition-normal);
}

.viewer-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(212, 175, 55, 0.2);
    border-top-color: var(--primary-light);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.viewer-loading p {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Current Tour Info */
.current-tour-info {
    position: absolute;
    top: 1rem;
    left: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(0, 0, 0, 0.8);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    z-index: 20;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.tour-number {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-light);
    background: rgba(139, 0, 0, 0.4);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
}

.tour-name {
    font-family: 'Playfair Display', serif;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Viewer Controls */
.viewer-controls {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    gap: 0.5rem;
    z-index: 20;
}

.control-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 8px;
    color: var(--text-light);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.control-btn:hover {
    background: var(--primary);
    border-color: var(--primary-light);
}

.control-btn svg {
    width: 20px;
    height: 20px;
}

/* ===========================================
   ANIMATIONS
   =========================================== */

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===========================================
   RESPONSIVE
   =========================================== */

@media (max-width: 1140px) {
    :root {
        --sidebar-width: 300px;
    }

    .sidebar-header {
        padding: 1.25rem;
    }

    .tour-nav {
        padding: 0.875rem;
    }

    .tour-btn {
        padding: 0.8rem 0.875rem;
    }

    .current-tour-info {
        max-width: calc(100% - 8rem);
    }
}

@media (max-width: 980px) {
    :root {
        --sidebar-width: 280px;
    }

    .logo-title {
        font-size: 0.95rem;
    }

    .tour-btn {
        font-size: 0.82rem;
    }

    .current-tour-info {
        gap: 0.6rem;
        padding: 0.65rem 0.85rem;
        max-width: calc(100% - 7rem);
    }

    .tour-name {
        font-size: 0.84rem;
    }
}

@media (max-width: 768px) {
    .tour-page {
        flex-direction: column;
    }

    .mobile-header {
        display: flex;
    }

    .mobile-title {
        flex: 1;
        min-width: 0;
        margin: 0 0.75rem;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .sidebar {
        position: fixed;
        top: 60px;
        left: 0;
        bottom: 0;
        width: min(280px, 86vw);
        transform: translateX(-100%);
        transition: transform var(--transition-normal);
        z-index: 1000;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.open {
        display: block;
    }

    .main-content {
        padding-top: 60px;
    }

    .current-tour-info {
        top: 70px;
        left: 0.5rem;
        right: 0.5rem;
        max-width: none;
        justify-content: center;
    }

    .viewer-controls {
        bottom: 1rem;
        right: 1rem;
    }

    .control-btn {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 640px) {
    .current-tour-info {
        gap: 0.5rem;
        padding: 0.6rem 0.75rem;
    }

    .tour-number {
        padding: 0.22rem 0.5rem;
    }

    .tour-name {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .mobile-header {
        padding: 0 0.75rem;
    }

    .mobile-title {
        font-size: 0.92rem;
    }

    .current-tour-info {
        top: 68px;
        left: 0.4rem;
        right: 0.4rem;
        gap: 0.45rem;
        padding: 0.55rem 0.65rem;
    }

    .tour-number {
        font-size: 0.68rem;
    }

    .tour-name {
        font-size: 0.76rem;
    }

    .viewer-controls {
        bottom: 0.75rem;
        right: 0.75rem;
        gap: 0.4rem;
    }

    .control-btn {
        width: 38px;
        height: 38px;
    }

    .control-btn svg {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 320px) {
    .mobile-header {
        padding: 0 0.55rem;
    }

    .mobile-title {
        margin: 0 0.45rem;
        font-size: 0.84rem;
    }

    .menu-toggle,
    .home-link {
        flex-shrink: 0;
    }

    .current-tour-info {
        padding: 0.5rem 0.55rem;
    }

    .tour-name {
        font-size: 0.72rem;
    }

    .viewer-controls {
        right: 0.5rem;
        bottom: 0.5rem;
    }

    .control-btn {
        width: 36px;
        height: 36px;
    }
}

@media (min-width: 1440px) {
    :root {
        --sidebar-width: 340px;
    }

    .logo-title {
        font-size: 1.06rem;
    }

    .tour-btn {
        font-size: 0.88rem;
    }
}

@media (min-width: 1620px) {
    :root {
        --sidebar-width: 360px;
    }

    .tour-btn {
        padding: 0.95rem 1.1rem;
    }

    .tour-name {
        font-size: 0.94rem;
    }

    .current-tour-info {
        padding: 0.85rem 1.15rem;
    }
}

@media (min-width: 1980px) {
    :root {
        --sidebar-width: 390px;
    }

    .logo-title {
        font-size: 1.12rem;
    }

    .tour-btn {
        font-size: 0.96rem;
    }

    .control-btn {
        width: 48px;
        height: 48px;
    }
}

@media (min-width: 2101px) {
    :root {
        --sidebar-width: 420px;
    }

    .sidebar-header,
    .sidebar-footer {
        padding-inline: 1.75rem;
    }

    .tour-nav {
        padding: 1.25rem;
    }

    .tour-name {
        font-size: 1rem;
    }

    .current-tour-info {
        padding: 0.95rem 1.25rem;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.5);
}
