:root {
    --primary-color: #4a6fa5;
    --secondary-color: #334e7b;
    --dark-color: #333;
    --light-color: #f4f4f4;
    --danger-color: #dc3545;
    --success-color: #28a745;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

header {
    background-color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    display: flex;
    justify-content: flex-start; /* Change from space-between to align items at start */
    align-items: center;
    padding: 1rem 0;
    position: relative; /* Add position relative */
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    margin-left: 0.5rem; /* Add margin to create space between hamburger and title */
}

.nav-links {
    display: flex;
    align-items: center;
    margin-left: auto; /* Push to the right */
}

.nav-links a {
    margin-left: 1rem;
}

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.3s;
}

.btn:hover {
    opacity: 0.9;
}

.btn-danger {
    background: var(--danger-color);
}

main {
    min-height: calc(100vh - 140px);
    padding: 2rem 0;
}

footer {
    padding: 1rem 0;
    background-color: var(--dark-color);
    color: white;
    text-align: center;
}

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

.form-control {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* Cards */
.card {
    background: white;
    padding: 1rem;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
}

/* Utilities */
.text-center {
    text-align: center;
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

/* Toast/Popup Message */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 25px;
    background-color: white;
    color: #333;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 1000;
    display: flex;
    align-items: center;
    transform: translateY(150%);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateY(0);
}

.toast-success {
    border-left: 4px solid var(--success-color);
}

.toast-error {
    border-left: 4px solid var(--danger-color);
}

.toast-info {
    border-left: 4px solid var(--primary-color);
}

/* Message Popup styling - Simplified for Safari compatibility */
.message-popup {
    position: fixed;
    bottom: 20px;
    right: -400px; /* Start off-screen */
    max-width: 350px;
    width: 90%;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    padding: 15px;
    z-index: 1000;
    transition: right 0.5s ease-in-out;
}

.message-popup.show {
    right: 20px; /* Move on-screen */
}

.message-popup .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.message-popup .close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 5px;
}

.message-popup .message {
    padding: 8px 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.message-popup .timestamp {
    display: block;
    font-size: 0.8rem;
    color: #777;
    text-align: right;
    margin-top: 5px;
}

/* Hamburger Menu Styles */
.hamburger-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-right: 0.5rem; /* Reduced margin */
    font-size: 1.5rem;
    color: var(--primary-color);
}

.hamburger-menu:hover {
    color: var(--secondary-color);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 150;
    display: none;
}

.overlay.active {
    display: block;
}

.nav-menu {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100%;
    background-color: white;
    z-index: 1000; /* Much higher z-index than the overlay */
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    transition: left 0.3s ease;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-menu.active {
    left: 0;
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem 1rem;
    border-bottom: 1px solid #eee;
    margin-bottom: 1rem;
}

.menu-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.menu-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--dark-color);
}

.menu-items {
    list-style: none;
    padding: 0;
}

.menu-item {
    margin-bottom: 0.5rem;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--dark-color);
    text-decoration: none;
    font-weight: 500;
}

.menu-link i:first-child {
    width: 24px;
    margin-right: 0.75rem;
    color: var(--primary-color);
}

.menu-link span {
    flex-grow: 1;
}

.menu-link .arrow {
    transition: transform 0.3s;
}

.menu-link:hover {
    background-color: #f5f5f5;
}

.submenu {
    list-style: none;
    padding-left: 1rem;
    max-height: none;
    overflow: visible;
}

.submenu-item {
    margin: 0.25rem 0;
}

.submenu-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    color: var(--dark-color);
    text-decoration: none;
}

.submenu-link i {
    width: 20px;
    margin-right: 0.75rem;
    color: var(--primary-color);
}

.submenu-link:hover {
    background-color: #f5f5f5;
}

.menu-item.active .menu-link .arrow {
    transform: rotate(180deg);
}

.menu-item.active .submenu {
    max-height: 500px;
    transition: max-height 0.5s ease-in;
}

.menu-section-header {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    font-weight: bold;
    color: var(--secondary-color);
    background-color: #f0f4f8;
    border-left: 4px solid var(--primary-color);
    margin-bottom: 0.5rem;
}

.menu-section-header i {
    width: 24px;
    margin-right: 0.75rem;
    color: var(--primary-color);
}

.always-visible-submenu {
    list-style: none;
    padding-left: 1rem;
    margin-bottom: 1.5rem;
}

/* Construction page styles */
.construction-container {
    text-align: center;
    padding: 3rem 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.construction-icon {
    font-size: 6rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    animation: pulse 2s infinite;
}

.construction-container h1 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.construction-container h2.section-name {
    color: var(--secondary-color);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 0.5rem 1rem;
    background-color: #f5f5f5;
    border-radius: 5px;
    display: inline-block;
}

.construction-container p {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.construction-container .btn {
    margin-top: 1.5rem;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-links {
        margin-top: 0.5rem;
        align-self: flex-start;
    }

    .nav-links a {
        margin-left: 0;
        margin-right: 1rem;
    }
}
