/* ------------------------------------------- */
/* --- Cinesist Login/Register Modal Styles --- */
/* ------------------------------------------- */

/* Modal Overlay: Covers the entire screen, initially hidden */
.cinesist-modal-overlay {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85); /* Dark, semi-transparent overlay */
    backdrop-filter: blur(5px); /* Subtle blur effect */
    z-index: 99999; /* Ensure it's above everything else */
    justify-content: center; /* Center content horizontally */
    align-items: center; /* Center content vertically */
    overflow-y: auto; /* Allow scrolling for modal content if it's too tall */
    padding: 20px; /* Padding for mobile views */
}

/* Modal Content Box */
.cinesist-modal-content {
    background-color: var(--cinesist-dark-grey); /* Dark background for the modal */
    border: 2px solid var(--cinesist-border-color); /* Subtle border */
    border-radius: 10px;
    padding: 25px; /* CHANGED: Reduced from 30px to 25px */
    position: relative;
    width: 100%;
    max-width: 450px; /* Max width for desktop */
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.6); /* Deeper shadow */
    animation: fadeInScale 0.3s ease-out forwards; /* Entry animation */
    box-sizing: border-box; /* Include padding in width */
}

/* Close button */
.cinesist-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2.5rem; /* Larger for better tap target */
    line-height: 1;
    color: var(--cinesist-light-grey); /* Light grey for visibility */
    cursor: pointer;
    transition: color 0.2s ease-in-out, transform 0.2s ease-in-out;
    padding: 5px; /* Increase clickable area */
}

.cinesist-modal-close:hover {
    color: var(--cinesist-red-accent); /* Red on hover */
    transform: rotate(90deg); /* Little spin on hover */
}

/* Modal Header */
.cinesist-modal-header {
    text-align: center;
    margin-bottom: 20px; /* CHANGED: Reduced from 25px to 20px */
}

.cinesist-modal-title {
    color: var(--cinesist-white-text); /* White for distinct titles */
    font-family: var(--cinesist-heading-font);
    font-size: 2.2rem;
    margin-bottom: 5px;
    line-height: 1.2;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.4);
}

.cinesist-modal-subtitle {
    color: var(--cinesist-heading-color); /* Gold for subtitles */
    font-family: var(--cinesist-body-font);
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 0;
    text-shadow: 0.5px 0.5px 2px rgba(0,0,0,0.3);
}

/* Form Styling */
.cinesist-auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px; /* CHANGED: Reduced from 15px to 12px */
}

.cinesist-auth-form.hidden {
    display: none; /* Used by JS to toggle forms */
}

.cinesist-form-message {
    text-align: center;
    font-size: 0.95rem;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 12px; /* CHANGED: Reduced from 15px to 12px */
    display: none; /* Hidden until message needs to be shown by JS */
}

.cinesist-form-message.success {
    background-color: rgba(50, 150, 50, 0.2); /* Green tint for success */
    color: #90EE90; /* Light green text */
    border: 1px solid #329632;
    display: block;
}

.cinesist-form-message.error {
    background-color: rgba(200, 50, 50, 0.2); /* Red tint for error */
    color: #FF6347; /* Tomato red text */
    border: 1px solid #C83232;
    display: block;
}

.cinesist-form-group {
    margin-bottom: 8px; /* CHANGED: Reduced from 10px to 8px */
}

.cinesist-form-group label {
    display: block;
    color: var(--cinesist-light-grey); /* Light grey for labels */
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
    font-family: var(--cinesist-body-font);
}

.cinesist-form-group input[type="text"],
.cinesist-form-group input[type="email"],
.cinesist-form-group input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    background-color: var(--cinesist-dark-grey-lighter); /* Slightly lighter dark grey for inputs */
    border: 1px solid var(--cinesist-border-color);
    border-radius: 5px;
    color: var(--cinesist-text-color); /* White text in inputs */
    font-family: var(--cinesist-body-font);
    font-size: 1rem;
    box-sizing: border-box; /* Include padding in width */
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.cinesist-form-group input[type="text"]:focus,
.cinesist-form-group input[type="email"]:focus,
.cinesist-form-group input[type="password"]:focus {
    border-color: var(--cinesist-purple); /* Purple highlight on focus */
    outline: none;
    box-shadow: 0 0 0 3px rgba(128, 0, 128, 0.3); /* Soft purple glow */
}

/* Form options (Remember Me & Forgot Password) */
.cinesist-form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: -5px; /* Pull up a bit */
    margin-bottom: 12px; /* CHANGED: Reduced from 15px to 12px */
    font-size: 0.9rem;
}

/* Custom Checkbox (Remember Me) */
.cinesist-checkbox-container {
    display: block;
    position: relative;
    padding-left: 25px;
    cursor: pointer;
    color: var(--cinesist-light-grey);
    user-select: none;
}

.cinesist-checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.cinesist-checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 18px;
    width: 18px;
    background-color: var(--cinesist-dark-grey-lighter);
    border: 1px solid var(--cinesist-border-color);
    border-radius: 3px;
}

.cinesist-checkbox-container:hover input ~ .cinesist-checkmark {
    background-color: #3a3a3a; /* Darker on hover */
}

.cinesist-checkbox-container input:checked ~ .cinesist-checkmark {
    background-color: var(--cinesist-red-accent); /* Red when checked */
    border-color: var(--cinesist-red-accent);
}

.cinesist-checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.cinesist-checkbox-container input:checked ~ .cinesist-checkmark:after {
    display: block;
}

.cinesist-checkbox-container .cinesist-checkmark:after {
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid var(--cinesist-white-text);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}


/* Forgot Password Link */
.cinesist-forgot-password {
    color: var(--cinesist-light-grey); /* Light grey for link */
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

.cinesist-forgot-password:hover {
    color: var(--cinesist-red-accent); /* Red on hover */
}

/* Modal Buttons (Login/Register) */
.cinesist-modal-button {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 5px;
    font-family: var(--cinesist-heading-font);
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, transform 0.1s ease-in-out, box-shadow 0.2s ease-in-out;
}

.cinesist-primary-button {
    background-color: var(--cinesist-red-accent); /* Red for primary action */
    color: var(--cinesist-white-text); /* White text on red */
    box-shadow: 0 4px 10px rgba(255, 0, 0, 0.2); /* Subtle red shadow */
}

.cinesist-primary-button:hover {
    background-color: #d10000; /* Darker red on hover */
    transform: translateY(-2px); /* Slight lift */
    box-shadow: 0 6px 15px rgba(255, 0, 0, 0.3);
}

/* Form Switcher Link */
.cinesist-switch-form {
    text-align: center;
    margin-top: 20px;
    font-size: 0.95rem;
    color: var(--cinesist-light-grey);
}

.cinesist-switch-form a {
    color: var(--cinesist-purple); /* Purple for secondary link */
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease-in-out;
}

.cinesist-switch-form a:hover {
    color: var(--cinesist-orange-accent); /* Orange on hover for contrast */
}

/* Animation for modal entry */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .cinesist-modal-content {
        padding: 20px;
        max-width: calc(100% - 40px); /* Adjust max-width for smaller screens */
    }

    .cinesist-modal-title {
        font-size: 1.8rem;
    }

    .cinesist-modal-subtitle {
        font-size: 1rem;
    }

    .cinesist-modal-close {
        font-size: 2rem;
        top: 10px;
        right: 10px;
    }
}

/* USER INTERFACE STYLE */
/* ------------------------------------------- */
/* --- Dynamic User Menu Item Styles --- */
/* ------------------------------------------- */

/* Base styling for the custom user menu item wrapper */
.cinesist-user-menu-item {
    position: relative; /* Essential for dropdown positioning */
    list-style: none; /* Remove any default list bullets */
    padding: 0;
    margin: 0;
    /* Adjust margin/padding here if needed to align it perfectly within your header */
    /* Example: margin-left: 20px; */
}

/* Common styling for both logged-in and logged-out main links */
.cinesist-user-menu-link {
    display: flex; /* Use flexbox for horizontal alignment of avatar and text */
    align-items: center; /* Vertically center items within the link */
    gap: 10px; /* Space between the avatar/icon and the text */
    text-decoration: none;
    color: var(--cinesist-white-text); /* Use your theme's white text color */
    padding: 10px 15px; /* Padding around the avatar/text area, adjust as needed */
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
    border-radius: 5px; /* Slightly rounded corners for the hover background */
    cursor: pointer; /* Indicate it's clickable */
}

/* Hover state for the main user menu link */
.cinesist-user-menu-link:hover {
    background-color: rgba(255, 255, 255, 0.1); /* Subtle white overlay on hover */
    color: var(--cinesist-red-accent); /* Highlight text on hover */
}

/* Avatar styling (for logged-in state) */
.cinesist-user-avatar {
    width: 40px; /* Set the width of the avatar */
    height: 40px; /* Set the height of the avatar */
    border-radius: 50%; /* Makes the avatar perfectly round */
    object-fit: cover; /* Ensures the image covers the area without distortion */
    border: 2px solid var(--cinesist-heading-color); /* Gold border for the avatar */
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.3); /* Subtle gold glow */
}

/* Default avatar icon (for logged-out state) */
.cinesist-default-avatar {
    font-size: 38px; /* Slightly larger Font Awesome icon for visual balance */
    color: var(--cinesist-heading-color); /* Gold color for the default icon */
    line-height: 1; /* Ensures the icon aligns vertically well */
}

/* Text styling for display name/snarky text */
.cinesist-user-display-name,
.cinesist-snarky-login-text {
    font-family: var(--cinesist-body-font); /* Your main body font */
    font-weight: 600; /* Bolder text for prominence */
    white-space: nowrap; /* Prevents the text from wrapping to a new line */
    font-size: 1rem; /* Adjust font size if needed */
    line-height: 1.2; /* Helps with vertical alignment */
}

/* Dropdown Sub-Menu Styling */
.cinesist-user-menu-item .sub-menu {
    display: none; /* Hidden by default */
    position: absolute;
    top: 100%; /* Position directly below the main menu item */
    right: 0; /* Align the dropdown to the right edge of the parent item */
    background-color: var(--cinesist-dark-grey); /* Dark background for the dropdown */
    border: 1px solid var(--cinesist-border-color); /* Subtle border */
    border-radius: 8px; /* Rounded corners for the dropdown box */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6); /* Deeper shadow for depth */
    min-width: 180px; /* Minimum width to ensure content fits */
    z-index: 1000; /* Ensure it's on top of most other content */
    padding: 10px 0; /* Vertical padding inside the dropdown */
    list-style: none; /* Remove bullet points from dropdown items */
    margin: 0; /* Remove default list margins */
    opacity: 0; /* Start completely transparent for fade-in effect */
    visibility: hidden; /* Hide from screen readers when not visible */
    transform: translateY(10px); /* Start slightly below to slide up */
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease; /* Smooth transition for appearance */
}

/* Show dropdown on hover of the main menu item */
.cinesist-user-menu-item:hover > .sub-menu {
    display: block; /* Make the dropdown visible */
    opacity: 1; /* Fade in */
    visibility: visible; /* Make visible to screen readers */
    transform: translateY(0); /* Slide into final position */
}

/* Dropdown individual list items (no specific styling unless needed) */
.cinesist-user-menu-item .sub-menu li {
    margin: 0;
    padding: 0;
}

/* Dropdown links */
.cinesist-user-menu-item .sub-menu li a {
    display: flex; /* Use flex for icon and text alignment */
    align-items: center; /* Vertically center icon and text */
    padding: 10px 15px; /* Padding for each dropdown menu item */
    color: var(--cinesist-light-grey); /* Light grey text color */
    text-decoration: none;
    white-space: nowrap; /* Prevent text wrapping within dropdown items */
    transition: background-color 0.2s ease, color 0.2s ease;
    font-family: var(--cinesist-body-font);
    font-size: 0.95rem; /* Slightly smaller font for dropdown items */
    line-height: 1.2; /* Adjust line height for better spacing */
}

/* Hover state for dropdown links */
.cinesist-user-menu-item .sub-menu li a:hover {
    color: var(--cinesist-white-text); /* White text on hover */
}

/* Styling for the custom pushpin "📌" emoji icon */
.cinesist-pin-icon {
    margin-right: 8px; /* Space between the emoji and the text */
    font-size: 1.2em; /* Make the emoji slightly larger than the text for emphasis */
    line-height: 1; /* Crucial for better vertical alignment of emojis */
    display: inline-block; /* Helps with vertical alignment and margin application */
    /* Emojis can be tricky with alignment, adjust font-size or line-height if needed */
}
/* Styling for the custom Cine-freak "🤯" emoji icon */
.cinesist-cinefreak-icon {
    margin-right: 8px; /* Space between the emoji and the text */
    font-size: 1.2em; /* Make the emoji slightly larger than the text for emphasis */
    line-height: 1; /* Crucial for better vertical alignment of emojis */
    display: inline-block; /* Helps with vertical alignment and margin application */
    /* Emojis can be tricky with alignment, adjust font-size or line-height if needed */
}
/* Styling for the custom pushpin "😴" emoji icon */
.cinesist-sleepy-icon {
    margin-right: 8px; /* Space between the emoji and the text */
    font-size: 1.2em; /* Make the emoji slightly larger than the text for emphasis */
    line-height: 1; /* Crucial for better vertical alignment of emojis */
    display: inline-block; /* Helps with vertical alignment and margin application */
    /* Emojis can be tricky with alignment, adjust font-size or line-height if needed */
}

/* Specific styling for the 'Log Out' button (optional, but good for prominence) */
.cinesist-user-menu-item .sub-menu li a[href*="wp-login.php?action=logout"] {
    color: var(--cinesist-red-accent); /* Make logout link stand out */
    font-weight: 600; /* Bolder text for logout */
    margin-top: 5px; /* Add a little space above logout */
    border-top: 1px solid rgba(255, 255, 255, 0.1); /* Separator line */
    padding-top: 15px; /* More padding due to separator */
}

.cinesist-user-menu-item .sub-menu li a[href*="wp-login.php?action=logout"]:hover {
    background-color: var(--cinesist-red-accent); /* Red background on hover */
    color: var(--cinesist-white-text); /* White text on hover */
}
