/* Author: Alberto Arce, Arcasoft */
/* Redesign: Jules */

:root {
    /* WayWhispery Palette */
    --ww-green-light: #66CDAA;
    --ww-green-dark: #20B2AA;
    --ww-bg-dark: #1e2a2a;
    --ww-panel-bg: #182424;
    --ww-border-color: #3a4a4a;
    --ww-text-light: #E0FFFF;
    --ww-text-secondary: #a0b0b0;
    --ww-accent-yellow: #FFD700;

    /* Button Colors */
    --btn-primary-bg: var(--ww-green-dark);
    --btn-primary-hover-bg: var(--ww-green-light);
    --btn-secondary-bg: #4A5568;
    --btn-secondary-hover-bg: #2D3748;
    --btn-danger-bg: #C53030;
}

/* --- Base & Layout --- */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--ww-bg-dark);
    color: var(--ww-text-light);
}

.app-container {
    display: flex;
    height: 100vh;
}

/* --- Activity Bar --- */
.activity-bar {
    width: 50px;
    background-color: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 10px;
    z-index: 1001;
}
.activity-btn {
    background: none;
    border: none;
    color: var(--ww-text-secondary);
    font-size: 24px;
    padding: 15px 0;
    width: 100%;
    cursor: pointer;
    transition: color 0.2s, background-color 0.2s;
}
.activity-btn:hover {
    color: white;
}
.activity-btn.active {
    color: var(--ww-green-light);
    background-color: rgba(102, 205, 170, 0.1);
}
.activity-bar .spacer {
    flex-grow: 1;
}
#auth-container-activity {
    padding-bottom: 10px;
}

/* --- Sidebar --- */
.sidebar {
    width: 320px;
    background-color: var(--ww-panel-bg);
    border-right: 1px solid var(--ww-border-color);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: width 0.3s ease-in-out, padding 0.3s ease-in-out;
    overflow: hidden;
    flex-shrink: 0; /* Prevent sidebar from shrinking smaller than content */
}

.sidebar.collapsed {
    width: 0;
    border-right: none;
}
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid var(--ww-border-color);
    flex-shrink: 0;
}
#sidebar-logo {
    height: 30px;
    width: 30px;
    border-radius: 5px;
    cursor: pointer;
}
.sidebar-header h3 {
    margin: 0;
    font-size: 1rem;
    flex-grow: 1;
    padding-left: 15px;
}
#sidebar-header-controls {
    display: flex;
    gap: 5px;
}
.sidebar-content {
    padding: 15px;
    overflow-y: auto;
    flex-grow: 1;
}
.sidebar-view {
    display: none; /* Hidden by default */
    flex-direction: column;
    height: 100%;
}
.sidebar-view.active {
    display: flex; /* Shown when active */
}

/* --- Main Content --- */
.main-content {
    flex-grow: 1;
    position: relative;
}
#map-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* --- UI Elements --- */
#guide-catalog-list .card {
    background-color: rgba(0,0,0,0.2);
    border: 1px solid var(--ww-border-color);
    margin-bottom: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
}
#guide-catalog-list .card:hover {
    background-color: rgba(102, 205, 170, 0.1);
}
#guide-catalog-list .card-title {
    color: var(--ww-green-light);
    margin: 0 0 5px 0;
}
#guide-catalog-list .card-text {
    font-size: 0.9rem;
    color: var(--ww-text-secondary);
    margin: 0;
}

#poi-list {
    list-style: none;
    padding: 0;
}
.list-group-item {
    padding: 10px;
    border-bottom: 1px solid var(--ww-border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}
.list-group-item:hover {
    background-color: rgba(102, 205, 170, 0.1);
}
.list-group-item.visited {
    background-color: rgba(102, 205, 170, 0.2);
    text-decoration: line-through;
    color: var(--ww-text-secondary);
}

/* --- Buttons --- */
.btn-modern {
    border-radius: 5px;
    padding: 8px 12px;
    font-weight: bold;
    border: none;
    transition: all 0.2s ease;
    cursor: pointer;
    color: white;
    text-decoration: none;
    background-color: var(--btn-primary-bg);
}
.btn-modern:hover {
    background-color: var(--btn-primary-hover-bg);
}
.btn-modern-sm {
    padding: 5px 8px;
    font-size: 0.8rem;
}
.btn-modern-secondary {
    background-color: var(--btn-secondary-bg);
}
.btn-modern-secondary:hover {
    background-color: var(--btn-secondary-hover-bg);
}
.btn-modern-danger {
    background-color: var(--btn-danger-bg);
}

.btn-group {
    display: flex;
    gap: 5px;
}
.btn-group .btn-modern {
    width: auto;
}

/* --- Modal Styles --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}
.modal-overlay.hidden {
    display: none;
}
.modal-content {
    background-color: var(--ww-panel-bg);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--ww-border-color);
    width: 90%;
    max-width: 500px;
    position: relative;
    color: var(--ww-text-light);
}
.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--ww-text-secondary);
    cursor: pointer;
}

/* Form Styles */
.form-group {
    margin-bottom: 1rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--ww-text-secondary);
    font-weight: bold;
}
.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--ww-border-color);
    background-color: var(--ww-bg-dark);
    color: var(--ww-text-light);
    box-sizing: border-box;
}
.form-group small {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--ww-text-secondary);
}
#form-modal-content .btn-modern {
    margin-top: 1rem;
    width: 100%;
}
.hidden {
    display: none !important;
}

/* --- Splash Screen --- */
#splash-screen .modal-content {
    background-color: var(--ww-bg-dark);
    border: none;
}
.splash-logo {
    width: 100px;
    height: 100px;
    border-radius: 20px;
    margin-bottom: 1rem;
}
.splash-marketing {
    font-size: 1.2rem;
    color: var(--ww-text-secondary);
    margin: 0.5rem 0;
}
.splash-details p {
    font-size: 0.8rem;
    color: var(--ww-text-secondary);
    margin: 0.2rem 0;
}
.loader {
    margin: 1.5rem auto;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--ww-green-dark);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader.hidden {
    display: none;
}

/* New Splash Screen Styles */
#language-selector-container {
    margin: 1.5rem 0;
}
.flags-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.5rem;
}
.flag-icon {
    width: 40px;
    height: auto;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid transparent;
}
.flag-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
.splash-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--ww-border-color);
}
.bmac-button img {
    height: 40px;
    width: auto;
    border-radius: 8px;
    transition: transform 0.2s;
}
.bmac-button:hover img {
    transform: scale(1.05);
}

/* --- Map Overlays --- */
#guide-text-overlay {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background-color: rgba(24, 36, 36, 0.8);
    backdrop-filter: blur(5px);
    color: var(--ww-text-light);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--ww-border-color);
    z-index: 999;
    max-height: 100px;
    overflow-y: auto;
}
#guide-text-overlay p {
    margin: 0;
    line-height: 1.5;
}

#controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 10px;
}
#controls .btn-modern {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.2rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* User Profile Display */
.user-profile-container {
    display: flex;
    align-items: center;
    gap: 10px; /* Space between email and button */
}

.user-profile-container .user-email {
    font-size: 0.9rem;
    color: #f0f0f0; /* Light color to match other UI elements */
    white-space: nowrap; /* Prevent wrapping */
    overflow: hidden;
    text-overflow: ellipsis; /* Add ... if name is too long */
    max-width: 150px; /* Adjust as needed */
}

/* Specific styling for the splash screen version */
.splash-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.splash-auth-container {
    flex-grow: 1;
    display: flex;
    justify-content: center;
}

.splash-footer .user-profile-container {
    justify-content: center; /* Center items in the splash footer */
}

.splash-footer .user-email {
    color: #333; /* Darker text for the light splash background */
    max-width: 200px;
}

/* Dropdown Menus in Activity Bar */
.dropdown-container {
    position: relative;
    display: inline-block;
    width: 100%;
}

.dropdown-menu {
    display: none; /* Hidden by default */
    position: absolute;
    left: var(--activity-bar-width); /* Position next to the activity bar */
    top: 0;
    background-color: #f9f9f9;
    min-width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1000;
    border-radius: 5px;
    padding: 10px;
    text-align: left;
}

.dropdown-menu.visible {
    display: block;
}

.dropdown-menu .user-email {
    color: #333;
    font-weight: bold;
    padding-bottom: 8px;
    border-bottom: 1px solid #ddd;
    margin-bottom: 8px;
    display: block;
    white-space: normal;
}

.dropdown-menu .logout-btn {
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    background: none;
    border: none;
    color: #333;
    cursor: pointer;
}

.dropdown-menu .logout-btn:hover {
    background-color: #f1f1f1;
}

/* Splash screen specific positioning */
.splash-footer .dropdown-menu {
    top: auto;
    bottom: 50px; /* Position above the splash footer button */
    left: 50%;
    transform: translateX(-50%);
}

/* JSON Preview in Modal */
.json-preview {
    width: 100%;
    min-height: 300px;
    max-height: 40vh;
    background-color: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 5px;
    padding: 15px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: monospace;
    font-size: 0.85rem;
    resize: vertical;
}

.validation-status {
    margin-top: 10px;
    font-weight: bold;
}

#activity-bar-logo {
    width: 28px;
    height: 28px;
    border-radius: 5px;
    object-fit: cover;
}
