/* Unified App Layout */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    flex-shrink: 0;
    z-index: 20;
    gap: 1.5rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-shrink: 0;
}

.header-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header-brand img {
    height: 40px;
    width: auto;
}

.header-brand h1 {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1;
    margin-top: -4px;
    color: var(--text-muted);
}

.app-main-nav {
    flex-grow: 1;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 0.5rem;
}

.nav-group {
    display: flex;
    align-items: center;
    background-color: var(--bg-alt);
    border-radius: 0.5rem;
    padding: 0.25rem;
    gap: 0.25rem;
    border: 1px solid var(--border);
}

.nav-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    min-width: 80px;
    border-radius: 0.375rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
    border: 1px solid transparent;
    text-decoration: none;
}
.nav-tab:hover {
    color: var(--text);
    background-color: var(--bg);
}

.nav-group .nav-tab {
    padding: 0.5rem 0.25rem;
    border-radius: 0.375rem;
}

.nav-icon {
    width: 20px;
    height: 20px;
    margin-bottom: 2px;
}
.nav-icon svg {
    width: 100%;
    height: 100%;
    stroke-width: 2;
}
.nav-text {
    font-size: 0.75rem;
    line-height: 1;
}

.nav-group .nav-tab.active {
    background-color: var(--surface);
    color: var(--accent);
    box-shadow: 0 1px 2px var(--shadow-color);
}
body.dark .nav-group .nav-tab.active {
    background-color: var(--accent);
    color: var(--btn-primary-text);
}
.nav-group .nav-tab.active .nav-icon {
    color: var(--accent);
}
body.dark .nav-group .nav-tab.active .nav-icon {
    color: var(--btn-primary-text);
}


.header-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-shrink: 0;
}

.hotelgroup-selector-container {
    width: 300px;
}

.animation-magic-icon { display: block; }
.animation-simple-icon { display: none; }
body.animation-mode-simple .animation-magic-icon { display: none; }
body.animation-mode-simple .animation-simple-icon { display: block; }

/* Footer */
.footer-v2 {
    position: fixed;
    width: 500px;
    bottom: 0;
    left: calc(50% - 250px);
    background: transparent;
    border: 1px solid #000;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    box-shadow: 1px 1px 3px 4px rgba(0, 0, 0, 0.13);
    transition: all 0.3s ease-in-out;
    transform: translate(0px, 15px) scale(0.6);
    color: #FFFFFF;
    text-shadow: #000 2px 2px 1px, #000 2px 2px 1px, #000 2px 2px 2px, #000 0 0 2px, #000 0 0 2px, #000 0 0 2px;
    font-smooth: always;
    font-size: medium;
    cursor: pointer;
    z-index: 50;
}

.footer-v2:hover {
    background-color: rgba(0, 0, 0, 0.67);
    border: 1px solid black;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    transform: translate(0px, 1px) scale(1);
}

.footer-inner-v2 {
    position: relative;
    text-align: center;
    padding: 0.3rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.footer-image-v2 {
    width: 65px;
    margin: 2px 10px;
    vertical-align: middle;
}

/* Main Page Layouts */
.pane-container { /* Viewer */
    display: grid;
    grid-template-columns: 50px 5px 1fr;
    height: calc(100vh - 60px);
    overflow: hidden;
    transition: grid-template-columns 0.3s ease-in-out;
}

.main-view-container { /* Editor & Campaigns */
    display: grid;
    grid-template-columns: var(--editor-left-width, 280px) 5px 1fr;
    height: calc(100vh - 90px); /* Use the corrected height */
    overflow: hidden; /* Keep this to prevent overall page scroll */
    transition: margin-right 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.main-view-container.usage-visible {
    grid-template-columns: var(--editor-left-width, 280px) 5px 1fr 5px var(--editor-right-width, 350px);
}


/* Resizer Handle */
.resizer, #resize-handle {
    width: 5px;
    height: 100%;
    background: var(--header-border);
    cursor: col-resize;
    z-index: 10;
    transition: background 0.2s ease;
}

.resizer:hover, #resize-handle:hover {
    background: var(--accent);
}


/* --- Responsive Header & Mobile Menu --- */
#mobile-menu-toggle {
    display: none;
}

#mobile-menu {
    position: fixed;
    top: 65px; /* Height of header */
    right: 0;
    width: 280px;
    height: calc(100% - 65px);
    background-color: var(--surface-bg);
    border-left: 1px solid var(--header-border);
    z-index: 100;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
}

#mobile-menu.visible {
    transform: translateX(0);
    box-shadow: -10px 0 25px rgba(0,0,0,0.2);
}

#mobile-menu .nav-group {
    flex-direction: column;
    align-items: stretch;
    background: none;
    border: none;
    padding: 0;
    gap: 0.5rem;
}
#mobile-menu .nav-tab {
    flex-direction: row;
    justify-content: flex-start;
    gap: 0.75rem;
    min-width: unset;
    padding: 0.75rem 1rem;
}
#mobile-menu .nav-text {
    font-size: 0.875rem;
}
#mobile-menu .nav-tab:hover {
    background-color: var(--bg-alt);
}
#mobile-menu .nav-tab.active {
    background-color: var(--accent-light);
    color: var(--accent-text);
    font-weight: 600;
}

.mobile-menu-divider {
    border: none;
    border-top: 1px solid var(--header-border);
    margin: 0.5rem 0;
}

.mobile-menu-controls {
    margin-top: auto; /* Push to bottom */
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@media (max-width: 1200px) {
    .app-main-nav {
        display: none;
    }
    .header-controls {
        display: none;
    }
    #mobile-menu-toggle {
        display: inline-flex;
    }
    .header-left {
        flex-grow: 1;
    }
}

@media (max-width: 768px) {
    .header-brand h1 {
        display: none; /* Hide text logo on very small screens */
    }
    .app-header {
        padding: 0.75rem 1rem;
        gap: 1rem;
    }
}