/* Sign in button on the top-right of the page */
.signin-btn {
    padding: 8px 16px;
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    height: 44px;
    cursor: pointer;
    transition: background-color 0.4s;
}

.signin-btn:hover {
    background-color: #1d4ed8;
}

/* Modern Modal Styles */
.signin-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.signin-modal.active {
    opacity: 1;
    visibility: visible;
}

.signin-modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    --base-spacing: min(1.5rem, 4vh);
    padding: var(--base-spacing);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: translateY(20px);
    transition: transform 0.4s ease;
    position: relative;
}

.signin-modal.active .signin-modal-content {
    transform: translateY(0);
}

.signin-modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #64748b;
    transition: color 0.4s;
}

.signin-modal-close:hover {
    color: #334155;
}

.signin-modal-header {
    padding: 20px 30px;
    background: #ffffff;
    color: #1e293b;
    border-bottom: none;
    box-shadow: none;
    text-align: center;
    margin-top: calc(var(--base-spacing) * 1.25);
    margin-bottom: calc(var(--base-spacing) * 0.75);
}

.signin-modal-header #signinModalPrompt {
    font-size: 24px;
    color: #1e293b;
    margin: 16px 0 8px 0; 
}

/* Dark theme */
.dark-theme .signin-modal-header {
    background: #1e293b;
    color: #f8fafc;
}

.dark-theme .signin-modal-header #signinModalPrompt {
    font-size: 24px;
    color: #f8fafc;
    margin: 16px 0 8px 0; 
}

.signin-modal-body {
    flex: 1;
    overflow-y: auto;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f8f9fa;
}

.signin-modal-body::-webkit-scrollbar {
  width: 10px;
}

.signin-modal-body::-webkit-scrollbar-track {
  background: #f8f9fa;
  border-radius: 10px;
}

.signin-modal-body::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 10px;
  border: 2px solid #f8f9fa;
}

.signin-modal-body::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

.signin-modal-title {
    font-size: 24px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}

/* Dark mode support */
.dark-theme .signin-modal-content {
    background: #1e293b;
    color: white;
}

.dark-theme .signin-modal-close {
    color: #94a3b8;
}

.dark-theme .signin-modal-close:hover {
    color: #f8fafc;
}

/* Email Login Form */
.email-login-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    padding: 0 16px; /* Match Google sign-in container padding */
    transition: all 0.4s ease;
}

.email-login-form.expanded {
    margin-top: 0;
    height: auto;
}

.form-group {
    width: 100%;
    max-width: 400px;
    margin-bottom: 16px;
}

.email-login-form input,
.email-login-btn {
    width: 100%;
    box-sizing: border-box;
    padding: 8 12px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    box-sizing: border-box;
}

/* Mobile: Reduce vertical spacing in modal divs */
@media (max-width: 600px) {
  .email-login-form {
    gap: 8px;
  }
  .signin-modal-content {
    padding: 8px 8px;
  }
  .signin-modal-header {
    margin-bottom: 8px;
  }
  .auth-options {
    gap: 0;
    margin: 0;
    padding: 0;
  }
}

/* Dark Theme Styles */
.dark-theme .email-login-form input {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

.email-login-btn {
    background: #3b82f6;
    color: white;
    border: none;
    font-weight: 500;
    cursor: pointer;
}

.email-login-btn:hover {
    background: #1d4ed8;
}

/* Divider with centered text */
.divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    width: 100%;
    max-width: 300px;
}

.divider-line {
    flex: 1;
    height: 1px;
    background-color: #e2e8f0;
}

.divider-text {
    padding: 0 15px;
    color: #64748b;
    font-size: 14px;
}

/* Dark theme modal */
.dark-theme .divider-line {
    background: #475569;
}

.dark-theme .divider-text {
    color: #94a3b8;
}

/* Google Sign-In Container
.google-signin-container {
    width: 400px;
    max-width: 100%;
    padding: 12px;
    margin: 0 auto 20px;
    display: flex;
    justify-content: center;
} */

/* Make modal content scrollable if too tall */
.signin-modal-content {
    max-height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin: 16px;
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
}

/* Modal overlay: ensure scrollable on mobile */
.signin-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0,0,0,0.4);
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Google Sign-In Button */
.g_id_signin_container_outer {
    width: 100% !important;
    padding: 0 16px;
}

.g_id_signin_container {
    width: 100%;
    max-width: 400px;
    height: 56px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    padding: 0 0 !important;
}

.g_id_signin {
    width: 100% !important;
    max-width: 400px;
    min-height: 56px;
    position: relative;
    padding: 0 0 !important;
}

.g_id_onload{
    width: 400px !important;
    margin: 0 20px 0 20px;
    display: flex;
    justify-content: center;
}

/* Header Styles */
.signin-modal-header {
    text-align: center;
    margin-bottom: calc(var(--base-spacing) * 0.75);
}

.signin-modal-header h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 1rem 0 0.5rem;
    color: #1e293b;
}

.signin-modal-header p {
    color: #64748b;
    margin: 0;
}

.signin-logo {
    height: 2rem;
    width: auto;
}

/* Form Styles */
.auth-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-group {
    margin-bottom: 0.3rem;
}

.form-group input {
    height: 44px;
    padding: 12px 16px;
    box-sizing: border-box;
    width: 100%;
    padding: 1rem 1rem;
    line-height: 1.2;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.4s;
}

.form-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.primary-btn {
    width: 100%;
    max-width: 400px;
    height: 44px;
    padding: 0; /* Remove padding to prevent offset */
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.4s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.primary-btn:hover {
    background-color: #1d4ed8;
}

/* Footer Links */
.auth-footer {
    margin-top: var(--base-spacing);
    text-align: center;
    font-size: 0.875rem;
}

.auth-footer p {
    margin: 0.5rem 0;
}

.signin-link {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

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

.signup-link {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

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

/* Dark Mode Adjustments */
.dark-theme .signin-modal-header h2 {
    color: #f8fafc;
}

.dark-theme .signin-modal-header p {
    color: #94a3b8;
}

.dark-theme .form-group input {
    background-color: #1e293b;
    border-color: #334155;
    color: #f8fafc;
}

.dark-theme .form-group input:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

/* Avatar Image Styling */
#userAvatarImg {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.form-group input[type="email"],
.form-group input[type="password"] {
    height: 44px;
    min-height: 44px;
    line-height: 44px;
    border-radius: 4px;
}

/* Responsive vertical spacing adjustments for very small screens */
@media (max-height: 600px) {
    .signin-modal-content {
        --base-spacing: min(1rem, 3vh);
    }
    .signin-logo {
        height: 1.75rem;
    }
}

/* Mobile Responsive Styles (width < 600px) */
@media (max-width: 600px) {
    .signin-modal {
        padding: 0 !important;
        align-items: stretch !important;
    }
    
    .signin-modal-content {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 100% !important;
        height: auto !important;
        border-radius: 0 !important;
        margin: 0 !important;
        padding: 20px 0 !important;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    
    .auth-footer {
        margin-top: auto;
        padding-bottom: 20px;
    }
    
    .g_id_signin {
        width: 100% !important;
        min-width: 100% !important;
        margin: 0 !important;
    }
    
    .auth-options {
        flex-grow: 1;
        width: 100%;
        padding: 0 16px;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .email-login-form {
        width: 100%;
        padding: 0 16px;
        box-sizing: border-box;
    }
    
    .divider {
        width: 100%;
        padding: 0 16px;
        box-sizing: border-box;
    }
    
    .divider-line {
        flex-grow: 1;
        min-width: 20px;
    }
    
    .divider-text {
        padding: 0 10px;
    }
    
    .form-group input[type="email"],
    .form-group input[type="password"] {
        width: 100% !important;
        max-width: none !important;
        box-sizing: border-box;
        height: 44px;
        min-height: 44px !important;
        line-height: 44px;
        padding-top: 0;
        padding-bottom: 0;
    }
    .primary-btn {
        height: 44px !important;
        line-height: 44px !important;
    }
    
    .form-group {
        width: 100%;
        padding: 0;
    }
}

#logoutBtn {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.form-email-wrong-prompt {
    color: red;
    font-size: 12px;
    display: block;
    visibility: hidden;
}

.verification-code {
    letter-spacing: 0.5em;
    font-family: monospace;
    text-align: center;
    font-size: 1.2em;
    padding: 10px 0;
    width: 100%;
}

.verification-code::placeholder {
    letter-spacing: normal;
}

/* Countdown Timer */
.countdown-container {
    text-align: center;
    margin: 15px 0;
    color: #666;
    font-size: 14px;
}

.countdown-container #countdown {
    font-weight: bold;
    color: #4a89dc;
}

/* Notification Styles */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    position: relative;
    padding: 15px 20px;
    border-radius: 5px;
    color: white;
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 350px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    transform: translateX(0);
    transition: all 0.3s ease;
}

.notification.closing {
    transform: translateX(100%);
    opacity: 0;
}

.notification-icon {
    font-size: 1.5rem;
}

.notification-content p {
    margin: 0;
    font-size: 0.9rem;
}

.notification-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    margin-left: auto;
}

/* Notification Types */
.notification.info {
    background: #3498db;
}

.notification.success {
    background: #2ecc71;
}

.notification.error {
    background: #e74c3c;
}

.notification.warning {
    background: #f39c12;
}

/* Password Recovery Page Specific Styles */
.auth-page .auth-logo {
    height: 28px;
    margin: 20px auto 20px;
}

.auth-page .auth-container {
    margin: 0 auto;
    width: 100%;
    max-width: 400px;
}

.auth-page .form-group {
    padding: 15px 0;
    margin-bottom: 20px;
}

.auth-page .auth-btn {
    padding: 12px 24px;
    background-color: #4a89dc;
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.auth-page .auth-btn:hover {
    background-color: #3a70c2;
}

.auth-page #email {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}