/* ============================================================================
   AUTHENTICATION UI STYLES
   ============================================================================ */

html, body {
    font-family: 'Lato', sans-serif;
}

* {
    font-family: 'Lato', sans-serif;
}

/* Auth Modal */
.auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.auth-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.auth-modal-content {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 40px 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    animation: slideUp 0.3s ease;
    box-sizing: border-box;
}

.auth-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 5px;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.auth-modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

/* Auth Tab */
.auth-tab {
    display: none;
}

.auth-tab.active {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.auth-tab.active .auth-form {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    overflow: visible !important;
}

.auth-tab.active .auth-form-group {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    overflow: visible !important;
}

.auth-tab.active .auth-form-group label {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.auth-tab.active .auth-form-group input {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    height: auto !important;
}

.auth-tab.active .auth-form-options {
    display: flex !important;
}

.auth-tab.active .auth-checkbox {
    display: flex !important;
}

.auth-tab.active .auth-btn {
    display: flex !important;
}

.auth-tab h2 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 700;
    color: #333;
    text-align: center;
}

.auth-subtitle {
    text-align: center;
    color: #666;
    margin: 0 0 30px 0;
    font-size: 14px;
}

/* Auth Messages */
.auth-message {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.auth-error {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.auth-success {
    background: #efe;
    color: #3c3;
    border: 1px solid #cfc;
}

/* Auth Buttons */
.auth-btn {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-btn-primary {
    background: rgb(3, 122, 122);
    color: #ffffff;
}

.auth-btn-primary:hover:not(:disabled) {
    background: rgb(2, 100, 100);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(3, 122, 122, 0.3);
}

.auth-btn-google {
    background: #ffffff;
    color: #3c4043;
    border: 1px solid #dadce0;
    border-radius: 4px;
    box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.25px;
    transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Roboto', 'Google Sans', 'Arial', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    margin-bottom: 15px;
    position: static;
    z-index: auto;
}

.auth-btn-google:hover:not(:disabled) {
    background: #f8f9fa;
    box-shadow: 0 1px 3px 0 rgba(60, 64, 67, 0.3), 0 4px 8px 3px rgba(60, 64, 67, 0.15);
}

.auth-btn-google:active:not(:disabled) {
    background: #f1f3f4;
    box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 2px 1px rgba(60, 64, 67, 0.15);
}

.auth-btn-google i,
.auth-btn-google .google-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    object-fit: contain;
    vertical-align: middle;
}

.auth-btn-google span {
    color: #3c4043;
    font-family: 'Roboto', 'Google Sans', 'Arial', sans-serif;
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.25px;
    line-height: 1.5;
}

/* Auth Divider */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 25px 0;
    text-align: center;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}

.auth-divider span {
    padding: 0 15px;
    color: #999;
    font-size: 14px;
}

/* Auth Form */
.auth-form {
    margin-top: 20px;
    width: 100%;
    display: block;
}

.auth-form-group {
    margin-bottom: 20px;
    width: 100%;
    display: block;
}

.auth-form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.auth-form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s ease;
    box-sizing: border-box;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.auth-form-group input[type="password"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
}

#authSignupPassword,
#authSignupPasswordConfirm,
#authSignupName,
#authSignupEmail {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
}

#authSignupForm .auth-form-group {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#authSignupForm .auth-form-options {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#authSignupForm #authSignupSubmitBtn {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.auth-form-group input:focus {
    outline: none;
    border-color: rgb(3, 122, 122);
    box-shadow: 0 0 0 3px rgba(3, 122, 122, 0.1);
}

.auth-form-group input:invalid:not(:placeholder-shown) {
    border-color: #c33;
}

.auth-form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 14px;
}

.auth-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.auth-checkbox input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

.auth-checkbox a {
    color: rgb(3, 122, 122);
    text-decoration: none;
}

.auth-checkbox a:hover {
    text-decoration: underline;
}

.auth-link {
    color: rgb(3, 122, 122);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.auth-link:hover {
    text-decoration: underline;
}

.auth-switch {
    text-align: center;
    margin-top: 25px;
    font-size: 14px;
    color: #666;
}

.auth-switch .auth-link {
    margin-left: 5px;
    font-weight: 600;
}

/* User Menu in Header */
#authUserMenuTrigger {
    display: none;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

#authUserMenuTrigger:hover {
    background: rgba(255, 255, 255, 0.1);
}

#authUserMenuTrigger .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgb(3, 122, 122);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    overflow: hidden;
}

#authUserMenuTrigger .user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#authUserMenuTrigger .user-name {
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#authUserMenuTrigger .user-arrow {
    font-size: 12px;
    color: #b0b0b0;
    transition: transform 0.2s ease;
}

#authUserMenuTrigger.active .user-arrow {
    transform: rotate(180deg);
}

#authUserMenu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    min-width: 200px;
    z-index: 1000;
    overflow: hidden;
    animation: slideDown 0.2s ease;
}

#authUserMenu.active {
    display: block !important;
}

.auth-user-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #b0b0b0;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s ease;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.auth-user-menu-item:hover {
    background: #2a2a2a;
    color: #ffffff;
}

.auth-user-menu-item i {
    width: 18px;
    color: rgb(3, 122, 122);
}

.auth-user-menu-item.danger {
    color: #ff6b6b;
    border-top: 1px solid #2a2a2a;
}

.auth-user-menu-item.danger:hover {
    background: #2a2a2a;
    color: #ff5252;
}

.auth-user-menu-item.danger i {
    color: #c33;
}

/* Login Button in Header */
#authLoginBtn {
    display: none;
    padding: 8px 16px;
    background: transparent;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

#authLoginBtn:hover {
    background: transparent;
    transform: translateY(-1px);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .auth-modal-content {
        width: 95%;
        padding: 30px 20px;
        max-height: 95vh;
    }

    .auth-tab h2 {
        font-size: 24px;
    }

    #authUserMenuTrigger .user-name {
        display: none;
    }

    #authUserMenu {
        right: -10px;
        min-width: 180px;
    }
}

/* ============================================================================
   AUTO LOGIN POPUP STYLES
   ============================================================================ */

.auto-login-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.auto-login-popup.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.auto-login-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
}

.auto-login-popup-content {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    padding: 40px 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    animation: slideUp 0.3s ease;
    box-sizing: border-box;
}

.auto-login-popup-header {
    text-align: center;
    margin-bottom: 30px;
}

.auto-login-popup-header h3 {
    margin: 0 0 10px 0;
    font-size: 26px;
    font-weight: 700;
    color: #333;
}

.auto-login-popup-header p {
    margin: 0;
    font-size: 16px;
    color: #666;
    line-height: 1.5;
}

.auto-login-popup-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.auto-login-btn {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: 'Lato', sans-serif;
}

.auto-login-btn-primary {
    background: rgb(3, 122, 122);
    color: #ffffff;
}

.auto-login-btn-primary:hover {
    background: rgb(2, 100, 100);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(3, 122, 122, 0.3);
}

.auto-login-btn-secondary {
    background: #ffffff;
    color: #3c4043;
    border: 1px solid #dadce0;
    box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
    font-weight: 500;
    font-size: 14px;
}

.auto-login-btn-secondary:hover {
    background: #f8f9fa;
    box-shadow: 0 1px 3px 0 rgba(60, 64, 67, 0.3), 0 4px 8px 3px rgba(60, 64, 67, 0.15);
}

.auto-login-btn i {
    font-size: 18px;
}

.auto-login-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 5px;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.auto-login-popup-close:hover {
    background: #f5f5f5;
    color: #333;
}

/* Responsive */
@media (max-width: 768px) {
    .auto-login-popup-content {
        width: 95%;
        padding: 30px 20px;
    }

    .auto-login-popup-header h3 {
        font-size: 22px;
    }

    .auto-login-popup-header p {
        font-size: 14px;
    }

    .auto-login-btn {
        padding: 12px 18px;
        font-size: 15px;
    }
}

