/* css/auth.css */

/* Auth Button Container in Navbar */
#auth-button-container {
    display: flex;
    justify-content: center;
}

.auth-nav-btn {
    background-color: #e50914;
    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 0.9em;
    margin-left: auto;
    margin-right: auto;
}

.auth-nav-btn:hover {
    background-color: #f40612;
}

/* User Profile Area in Navbar */
#user-profile-area {
    display: none; /* Hidden by default, shown by JS when logged in */
    align-items: center;
    gap: 10px;
}

#user-profile-area #user-email-display {
    color: #fff;
    font-size: 0.9em;
}

#user-profile-area #logout-button {
    background-color: #555;
    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 0.9em;
}

#user-profile-area #logout-button:hover {
    background-color: #777;
}

/* Auth Modals */
.auth-modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1001; /* Higher than navbar */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
}

.auth-modal-content {
    background-color: #141414; /* Dark theme for modal */
    color: #fff;
    margin: auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.auth-modal .close-button {
    color: #aaa;
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.auth-modal .close-button:hover,
.auth-modal .close-button:focus {
    color: #fff;
    text-decoration: none;
}

.auth-modal h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #e50914;
}

.auth-modal label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    font-size: 0.9em;
}

.auth-modal input[type="text"],
.auth-modal input[type="email"],
.auth-modal input[type="password"] {
    width: calc(100% - 22px); /* Adjusted for padding and border */
    padding: 12px 10px;
    margin-bottom: 20px;
    border: 1px solid #333;
    border-radius: 4px;
    background-color: #333;
    color: #fff;
    font-size: 1em;
}

.auth-modal input[type="text"]:focus,
.auth-modal input[type="email"]:focus,
.auth-modal input[type="password"]:focus {
    outline: none;
    border-color: #e50914;
    box-shadow: 0 0 5px rgba(229, 9, 20, 0.5);
}

.auth-modal button[type="submit"] {
    background-color: #e50914;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%;
    margin-top: 10px; /* Space above button */
}

.auth-modal button[type="submit"]:hover {
    background-color: #f40612;
}

/* Inline messages for auth feedback */
.auth-message {
    padding: 10px;
    margin-top: 0;
    margin-bottom: 15px;
    border-radius: 4px;
    font-size: 0.9em;
    text-align: center;
    display: none; /* Hidden by default, shown by JS */
}

/* Specific colors will be set by JS, but can define defaults if needed */
/* .auth-message.success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; } */
/* .auth-message.error { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; } */


/* Links within modals (e.g., Forgot Password, Go to Signup) */
.auth-modal-link {
    display: block;
    text-align: center;
    margin-top: 15px;
    font-size: 0.9em;
    color: #b3b3b3; /* Lighter grey for links */
    text-decoration: none;
}

.auth-modal-link:hover {
    color: #fff;
    text-decoration: underline;
}

/* Responsive adjustments if necessary */
@media (max-width: 480px) {
    .auth-modal-content {
        padding: 20px;
    }
    .auth-modal h2 {
        font-size: 1.5em;
    }
}

.auth-modal .switch-modal-link {
    display: block;
    text-align: center;
    margin-top: 20px;
    color: #bbb;
    font-size: 0.9em;
}

.auth-modal .switch-modal-link a {
    color: #fff;
    text-decoration: underline;
    cursor: pointer;
}

/* Signup Confirmation Note */
.signup-confirmation-note {
  font-size: 0.8em;
  margin-top: 10px;
  text-align: center;
  color: #FFD700; /* Yellow color for emphasis */
}

/* Responsive adjustments for signup confirmation note */
@media (max-width: 600px) {
  .signup-confirmation-note {
    font-size: 0.75em; /* Slightly smaller for very small screens */
  }
}

.auth-modal .switch-modal-link a:hover {
    color: #e50914;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    #auth-button-container .auth-nav-btn,
    #user-profile-area #logout-button {
        padding: 7px 12px;
        font-size: 0.85em;
        text-align: center; /* Center email text on mobile */
    }

    #user-profile-area #user-email-display {
        font-size: 0.85em;
    }

    .auth-modal-content {
        padding: 25px;
    }

    .auth-modal h2 {
        font-size: 1.5em;
    }

    .auth-modal input[type="email"],
    .auth-modal input[type="password"] {
        padding: 10px;
        font-size: 0.95em;
    }

    .auth-modal button[type="submit"] {
        padding: 10px;
        font-size: 1em;
    }
}

/* Dropdown Menu for User Account */
.user-dropdown {
    position: relative; /* Allows absolute positioning for the dropdown-menu */
    display: inline-block; /* Or 'block' depending on layout needs */
}

.dropdown-toggle {
    /* Inherits .auth-nav-btn styles. Add specific overrides if needed. */
    cursor: pointer;
}

.dropdown-toggle .fa-caret-down {
    transition: transform 0.2s ease-in-out;
    margin-left: 5px; /* Added for spacing */
}

.dropdown-toggle[aria-expanded="true"] .fa-caret-down {
    transform: rotate(180deg);
}

.dropdown-menu {
    display: none; /* Hidden by default, JS will toggle this */
    position: absolute;
    top: 100%; /* Position below the toggle button */
    right: 0; /* Align to the right of the toggle button */
    background-color: #2c2c2c; /* Dark background, consistent with theme */
    border: 1px solid #444;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    min-width: 180px; /* Adjust as needed */
    z-index: 1000; /* Ensure it's above other content */
    padding: 5px 0; /* Padding for top/bottom of the menu */
    margin-top: 5px; /* Small gap between toggle and menu */
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 10px 15px; /* Adjusted padding for better touch targets */
    text-align: left;
    color: #f0f0f0; /* Light text color */
    background-color: transparent;
    border: none;
    font-size: 0.9em; /* Consistent font size with nav buttons */
    text-decoration: none; /* For <a> tags */
    line-height: 1.5;
    white-space: nowrap; /* Prevent wrapping */
    box-sizing: border-box; /* Ensure padding doesn't break width */
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: #e50914; /* JFlix red for hover/focus */
    color: #ffffff;
    text-decoration: none; /* Ensure no underline on hover for <a> */
    cursor: pointer;
}

/* Ensure buttons within dropdown look like other items */
button.dropdown-item {
    /* Specific styles for button if needed, otherwise inherits .dropdown-item */
    font-family: inherit; /* Ensure button font matches link font */
}
