/* Side Menu Styles */

/* Base menu styles */
.menu {
    position: fixed;
    top: 60px; /* Below header */
    width: 280px;
    height: calc(100vh - 60px);
    background-color: var(--menu-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 20px var(--menu-shadow);
    z-index: 99;
    overflow-y: auto;
    transition: transform 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
    padding: 20px 0;
}

/* Left Menu */
#left-menu {
    left: 0;
    transform: translateX(-100%);
    border-right: 1px solid var(--border-color);
    border-left: none;
}

#left-menu.show {
    transform: translateX(0);
}

/* Right Menu */
#right-menu {
    right: 0;
    transform: translateX(100%);
    border-left: 1px solid var(--border-color);
    border-right: none;
}

#right-menu.show {
    transform: translateX(0);
}

/* Menu content */
#menu-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-item {
    padding: 8px 25px; /* Reduced padding from 15px to 8px to decrease line spacing */
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
    border-bottom: 1px solid var(--border-color);
    font-weight: 500;
    color: var(--text-color);
    font-size: 16px; /* Explicit font size to ensure consistency with body */
}

.menu-item:hover:not(.disabled) {
    background-color: var(--button-hover);
    color: var(--accent-color);
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item.active {
    background-color: var(--menu-bg); /* Keep same background as inactive items */
    color: var(--text-color); /* Use normal text color instead of white */
    font-weight: 600; /* Make it slightly bolder to show it's active */
}

.menu-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Right menu specific styles */
#right-menu h2 {
    padding: 8px 25px 15px; /* Match the reduced padding from left menu items */
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
    font-size: 18px;
    font-weight: 700; /* Match left menu font weight */
}

#diario-items {
    padding: 0 25px;
}

.diario-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-color);
}

.diario-item:last-child {
    border-bottom: none;
}

/* User Menu Styles */
.user-menu {
    position: fixed;
    top: 60px;
    right: 20px;
    width: 350px;
    max-width: calc(100vw - 40px);
    background-color: var(--menu-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 20px var(--menu-shadow);
    z-index: 101;
    transform: translateY(-10px);
    opacity: 0;
    transition: all 0.3s ease;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
}

.user-menu.show {
    transform: translateY(0);
    opacity: 1;
}

.user-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.user-menu-overlay.show {
    opacity: 1;
}

/* User menu header */
.user-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.user-menu-header h3 {
    margin: 0;
    color: var(--text-color);
    font-size: 18px;
}

.close-user-menu {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-color);
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.close-user-menu:hover {
    background-color: var(--button-hover);
}

/* User menu content */
.user-menu-content {
    padding: 20px;
    text-align: center; /* Center align all content */
}

.menu-section {
    margin-bottom: 20px;
}

.menu-section:last-child {
    margin-bottom: 0;
}

.login-header,
.registration-header {
    text-align: center;
    margin-bottom: 20px;
}

.login-header h4,
.registration-header h4 {
    margin: 0 0 5px;
    color: var(--text-color);
    font-size: 18px; /* Increased from default */
}

.login-header p,
.registration-header p {
    margin: 0 0 15px;
    color: var(--text-color);
    opacity: 0.8;
    font-size: 16px; /* Increased from 14px */
}

.back-btn {
    background: none;
    border: none;
    color: var(--accent-color);
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 15px;
    padding: 5px 0;
}

.back-btn:hover {
    text-decoration: underline;
}

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

.menu-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 20px 0;
}

.registration-section,
.user-actions {
    text-align: center;
}

.registration-section h4 {
    margin: 0 0 5px;
    color: var(--text-color);
}

.registration-section p {
    margin: 0 0 15px;
    color: var(--text-color);
    opacity: 0.8;
    font-size: 14px;
}

.optional-fields-toggle {
    text-align: center;
    margin: 15px 0;
}

.optional-fields {
    margin-top: 15px;
}

/* User profile section */
.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar svg {
    width: 24px;
    height: 24px;
    stroke: white;
}

.user-info h4 {
    margin: 0 0 5px;
    color: var(--text-color);
}

.user-info p {
    margin: 0;
    font-size: 14px;
    color: var(--success-color);
}

/* User action buttons */
.menu-action-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    border-radius: 6px;
    margin-bottom: 8px;
    transition: background-color 0.3s ease;
    color: var(--text-color);
    font-size: 14px;
}

.menu-action-btn:hover {
    background-color: var(--button-hover);
}

.menu-action-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

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

.logout-btn:hover {
    background-color: rgba(220, 53, 69, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .menu {
        width: 100%;
        max-width: 300px;
    }

    .user-menu {
        right: 10px;
        left: 10px;
        width: auto;
    }
}

@media (max-width: 480px) {
    .user-menu {
        right: 5px;
        left: 5px;
        top: 65px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
}

#diario-items {
    padding: 0; /* Remove the 25px padding */
}

/* Theme headers should look like menu items */
.theme-header {
    display: block;
    padding: 8px 25px;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
    border-bottom: 1px solid var(--border-color);
    font-weight: 500;
    color: var(--text-color);
    font-size: 16px;
    text-decoration: none;
}

.theme-header:hover {
    background-color: var(--button-hover);
    color: var(--accent-color);
}

.theme-container {
    border-bottom: 1px solid var(--border-color);
}

.theme-container:last-child {
    border-bottom: none;
}

.theme-item-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.theme-item-list li {
    padding: 6px 25px 6px 40px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-color);
    transition: background-color 0.3s ease;
}

.theme-item-list li:hover {
    background-color: var(--button-hover);
}

.theme-item-list li:last-child {
    border-bottom: none;
}

.theme-item-list a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
}

.theme-item-list a:hover {
    text-decoration: underline;
}

body.logged-in #demo {
    display: none;
}