/* Hamburger Menu & Feedback Modal Styles */

/* --- Theme Toggle Button --- */
#theme-toggle {
    background: none;
    border: 1px solid var(--nudoors-gold);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 20px;
    transition: background-color 0.3s, border-color 0.3s;
}

#theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

#theme-toggle .sun-icon {
    display: none; /* Hidden by default */
}

#theme-toggle .moon-icon {
    display: inline; /* Shown by default */
}

[data-theme='dark'] #theme-toggle .sun-icon {
    display: inline; /* Show sun in dark mode */
}

[data-theme='dark'] #theme-toggle .moon-icon {
    display: none; /* Hide moon in dark mode */
}

.theme-switch-wrapper {
    display: flex;
    align-items: center;
    justify-content: center; /* Center the button */
    padding: 10px 0;
}

/* Header Structure Fix */
header {
    display: grid !important;
    grid-template-columns: 1fr 2fr 1fr !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0.25rem 1rem !important;
    position: relative;
}

/* Header Left Section */
.header-left {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
}

/* Hamburger Button */
.hamburger-button {
    position: relative; /* Needed for absolute positioning of lines */
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 2px; /* Sharper square */
    cursor: pointer;
    padding: 0; /* Remove padding, we'll center with flex */
    z-index: 1011; /* Sits on top of the menu overlay */
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    margin-left: 15px;
    transition: transform 0.3s ease-in-out;
}

.hamburger-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

/* New hamburger icon implementation */
.hamburger-icon-wrapper {
    width: 22px;
    height: 18px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger-line {
    width: 100%;
    height: 1px;
    background-color: #333; /* Default dark color for light mode */
    transition: all 0.3s ease-in-out;
}

/* X-transform for open menu */
.hamburger-button.is-active .line-middle {
    opacity: 0;
}

.hamburger-button.is-active .line-top {
    transform: translateY(8.5px) rotate(45deg);
}

.hamburger-button.is-active .line-bottom {
    transform: translateY(-8.5px) rotate(-45deg);
}

.hamburger-button:hover .hamburger-line {
    background-color: #f0f0f0;
}

/* Menu Overlay */
.menu-overlay {
    display: flex; /* Use flex instead of none */
    justify-content: flex-start;
    align-items: flex-start;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1010; /* Sits on top of page content, below the button */
    opacity: 0;
    pointer-events: none; /* Ignore clicks when hidden */
    transition: opacity 0.3s ease-in-out;
}

.menu-content {
    background: #fff;
    padding: 30px;
    padding-top: 70px; /* Make room for the hamburger button */
    border-radius: 0 0 10px 0;
    width: 300px;
    max-width: 80%;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    position: relative;
    /* z-index is not needed here, it's relative to the overlay */
    max-height: 100vh;
    overflow-y: auto;
}

.menu-overlay.is-active {
    opacity: 1;
    pointer-events: auto; /* Allow clicks when active */
}

.menu-overlay.is-active .menu-content {
    transform: translateX(0);
}

/* Menu Overlay Structure */
.menu-overlay {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1010;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
    overflow: hidden; /* Prevent scrolling the overlay itself */
}

.menu-content {
    background: #fff;
    padding: 30px;
    padding-top: 80px; /* Extra space for hamburger button */
    border-radius: 0 0 10px 0;
    width: 300px;
    max-width: 80%;
    height: 100%;
    max-height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    position: relative;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
}

.menu-overlay.is-active {
    opacity: 1;
    pointer-events: auto;
}

.menu-overlay.is-active .menu-content {
    transform: translateX(0);
}

/* This is handled by the JS adding a class directly to the button now */
.hamburger-button.is-active {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* New close button inside the menu */
.close-menu-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2.5rem;
    color: #888;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s ease;
}

.close-menu-btn:hover {
    color: #333;
}

/* Close button removed - using hamburger button instead */

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

.menu-items li {
    margin-bottom: 12px;
}

/* Ensure menu text is readable */
.menu-button, .menu-items a {
    font-weight: 500;
    color: #333;
}

/* Theme Switch / Dark Mode Styles */
.menu-content .theme-switch-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 20px;
    box-sizing: border-box;
}

.menu-content .dark-mode-label {
    display: flex;
    align-items: center;
    gap: 10px; /* Adds space between the label text and the switch */
}

.dark-mode-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 10px; /* Space between label and switch */
}

#dark-mode-toggle-label {
    display: inline-block;
    margin-right: 10px;
    color: #333;
    font-weight: 500;
    font-size: 16px;
}

.dark-mode-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

/* Toggle switch styling */
.slider {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
    background-color: #ccc;
    border-radius: 20px;
    transition: all 0.3s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: all 0.3s;
}

input:checked + .slider {
    background-color: #2196F3;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* Hide checkbox but keep it accessible */
.dark-mode-label input {
    position: absolute;
    opacity: 0;
    height: 0;
    width: 0;
}

.menu-button, .menu-link {
    display: flex;
    align-items: center;
    padding: 10px;
    border: none;
    background: none;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    color: #333;
    width: 100%;
    text-align: left;
    border-radius: 4px;
    transition: background-color 0.2s;
}

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

.menu-button i, .menu-link i {
    margin-right: 10px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    background: var(--nuvision-gradient);
    color: white;
    border-radius: 8px 8px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    display: flex;
    align-items: center;
    color: white;
}

.modal-header h2 i {
    margin-right: 10px;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: white;
}

.modal-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--nuvision-primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.form-actions {
    text-align: right;
    margin-top: 20px;
}

.btn-primary {
    background: var(--nuvision-gradient);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}
