/**
 * Authentication Styles
 * Login/Signup modal and form styles
 */

/* ============================================
   AUTH MODAL
   ============================================ */
.auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1100;
    overflow-y: auto;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.auth-modal-content {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 420px;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

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

/* ============================================
   MODAL HEADER
   ============================================ */
.auth-modal-header {
    padding: 24px 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.auth-modal-title {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.auth-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* ============================================
   MODAL BODY
   ============================================ */
.auth-modal-body {
    padding: 24px;
}

.auth-form-container {
    display: none;
}

.auth-form-container.active,
.auth-form-container:first-child {
    display: block;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */
.auth-form-group {
    margin-bottom: 20px;
}

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

.auth-input-wrapper {
    position: relative;
}

.auth-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 2px solid #e1dfdd;
    border-radius: 8px;
    background-color: #fff;
    color: #333;
    transition: all 0.2s ease;
}

.auth-input:focus {
    outline: none;
    border-color: #0078d4;
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

.auth-input::placeholder {
    color: #999;
}

.auth-input.is-invalid {
    border-color: #dc3545;
}

.auth-input.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

/* Password toggle button */
.auth-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
    font-size: 16px;
}

.auth-password-toggle:hover {
    color: #333;
}

.auth-input-wrapper .auth-input {
    padding-right: 44px;
}

/* Invalid feedback */
.invalid-feedback {
    display: none;
    font-size: 13px;
    color: #dc3545;
    margin-top: 6px;
}

.auth-input.is-invalid ~ .invalid-feedback {
    display: block;
}

/* ============================================
   CHECKBOX
   ============================================ */
.auth-checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #0078d4;
}

.auth-checkbox-label {
    font-size: 14px;
    color: #555;
    cursor: pointer;
}

/* ============================================
   SUBMIT BUTTON
   ============================================ */
.auth-submit-btn {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background-color: #0078d4;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-submit-btn:hover {
    background-color: #106ebe;
    transform: translateY(-1px);
}

.auth-submit-btn:active {
    transform: translateY(0);
}

.auth-submit-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.auth-submit-btn i {
    font-size: 14px;
}

/* ============================================
   FORM FOOTER
   ============================================ */
.auth-form-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e1dfdd;
}

.auth-form-footer p {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.auth-switch-link {
    color: #0078d4;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
}

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

/* Forgot password link */
.auth-forgot-link {
    display: block;
    text-align: right;
    font-size: 13px;
    color: #0078d4;
    text-decoration: none;
    margin-top: -12px;
    margin-bottom: 20px;
}

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

/* ============================================
   SOCIAL LOGIN (Optional)
   ============================================ */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
}

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

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

.auth-social-buttons {
    display: flex;
    gap: 12px;
}

.auth-social-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid #e1dfdd;
    border-radius: 8px;
    background-color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    color: #333;
    transition: all 0.2s ease;
}

.auth-social-btn:hover {
    border-color: #ccc;
    background-color: #f9f9f9;
}

/* ============================================
   HEADER AUTH BUTTONS
   ============================================ */
.header-auth-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-auth {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-auth-login {
    background-color: transparent;
    border: 1px solid #0078d4;
    color: #0078d4;
}

.btn-auth-login:hover {
    background-color: rgba(0, 120, 212, 0.1);
}

.btn-auth-signup {
    background-color: #0078d4;
    border: 1px solid #0078d4;
    color: #fff;
}

.btn-auth-signup:hover {
    background-color: #106ebe;
    border-color: #106ebe;
}

.btn-auth-directory {
    background-color: #107c10;
    border: 1px solid #107c10;
    color: #fff;
}

.btn-auth-directory:hover {
    background-color: #0b5c0b;
    border-color: #0b5c0b;
}

/* User dropdown */
.user-dropdown {
    position: relative;
}

.user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background-color: #f3f2f1;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: all 0.2s ease;
}

.user-dropdown-toggle:hover {
    background-color: #e1dfdd;
}

.user-avatar {
    width: 28px;
    height: 28px;
    background-color: #0078d4;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    display: none;
    z-index: 1000;
    overflow: hidden;
}

.user-dropdown.active .user-dropdown-menu {
    display: block;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.user-dropdown-item:hover {
    background-color: #f3f2f1;
}

.user-dropdown-item i {
    width: 20px;
    text-align: center;
    color: #666;
}

.user-dropdown-divider {
    height: 1px;
    background-color: #e1dfdd;
    margin: 4px 0;
}

.user-dropdown-item.logout {
    color: #dc3545;
}

.user-dropdown-item.logout i {
    color: #dc3545;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.auth-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 20px;
    background-color: #333;
    color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    max-width: 400px;
}

.auth-toast.show {
    transform: translateX(0);
}

.auth-toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-toast-content i {
    font-size: 20px;
}

.auth-toast-success {
    background-color: #107c10;
}

.auth-toast-error {
    background-color: #dc3545;
}

.auth-toast-info {
    background-color: #0078d4;
}

/* ============================================
   DARK THEME
   ============================================ */
body.dark-theme .auth-modal-content {
    background-color: #2d2d2d;
}

body.dark-theme .auth-modal-title {
    color: #e0e0e0;
}

body.dark-theme .auth-modal-close {
    color: #b0b0b0;
}

body.dark-theme .auth-modal-close:hover {
    background-color: #3d3d3d;
    color: #fff;
}

body.dark-theme .auth-label {
    color: #e0e0e0;
}

body.dark-theme .auth-input {
    background-color: #3d3d3d;
    border-color: #4d4d4d;
    color: #e0e0e0;
}

body.dark-theme .auth-input:focus {
    border-color: #0078d4;
}

body.dark-theme .auth-input::placeholder {
    color: #888;
}

body.dark-theme .auth-checkbox-label {
    color: #b0b0b0;
}

body.dark-theme .auth-form-footer {
    border-top-color: #3d3d3d;
}

body.dark-theme .auth-form-footer p {
    color: #b0b0b0;
}

body.dark-theme .auth-divider::before,
body.dark-theme .auth-divider::after {
    background-color: #3d3d3d;
}

body.dark-theme .auth-divider span {
    color: #888;
}

body.dark-theme .auth-social-btn {
    background-color: #3d3d3d;
    border-color: #4d4d4d;
    color: #e0e0e0;
}

body.dark-theme .auth-social-btn:hover {
    background-color: #4d4d4d;
    border-color: #5d5d5d;
}

body.dark-theme .user-dropdown-toggle {
    background-color: #3d3d3d;
    color: #e0e0e0;
}

body.dark-theme .user-dropdown-toggle:hover {
    background-color: #4d4d4d;
}

body.dark-theme .user-dropdown-menu {
    background-color: #2d2d2d;
}

body.dark-theme .user-dropdown-item {
    color: #e0e0e0;
}

body.dark-theme .user-dropdown-item:hover {
    background-color: #3d3d3d;
}

body.dark-theme .user-dropdown-item i {
    color: #b0b0b0;
}

body.dark-theme .user-dropdown-divider {
    background-color: #3d3d3d;
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */
@media (max-width: 768px) {
    .auth-modal {
        padding: 16px;
    }

    .auth-modal-content {
        max-width: 100%;
        border-radius: 12px;
    }

    .auth-modal-header {
        padding: 20px 20px 0;
    }

    .auth-modal-body {
        padding: 20px;
    }

    .auth-modal-title {
        font-size: 22px;
    }

    .header-auth-buttons {
        gap: 8px;
    }

    .btn-auth {
        padding: 8px 12px;
        font-size: 13px;
    }

    .btn-auth span {
        display: none;
    }

    .btn-auth i {
        margin: 0;
    }

    .auth-toast {
        left: 20px;
        right: 20px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .auth-modal-content {
        border-radius: 0;
        min-height: 100vh;
    }

    .auth-modal {
        padding: 0;
    }

    .auth-social-buttons {
        flex-direction: column;
    }

    .btn-auth-directory {
        display: none;
    }
}

/* ============================================
   LOADING SPINNER
   ============================================ */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fa-spin {
    animation: spin 1s linear infinite;
}

/* ============================================
   PASSWORD STRENGTH INDICATOR
   ============================================ */
.password-strength {
    margin-top: 8px;
}

.password-strength-bar {
    height: 4px;
    background-color: #e1dfdd;
    border-radius: 2px;
    overflow: hidden;
}

.password-strength-fill {
    height: 100%;
    width: 0;
    transition: all 0.3s ease;
}

.password-strength-fill.weak {
    width: 33%;
    background-color: #dc3545;
}

.password-strength-fill.medium {
    width: 66%;
    background-color: #ffc107;
}

.password-strength-fill.strong {
    width: 100%;
    background-color: #107c10;
}

.password-strength-text {
    font-size: 12px;
    margin-top: 4px;
    color: #666;
}
