/**
 * Authentication Styles
 * Modal, forms, and user interface styling
 */

/* Auth Modal */
#auth-modal {
    animation: fadeIn 0.3s ease-in-out;
}

#auth-modal.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Form Inputs */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select {
    transition: all 0.3s ease;
}

input:focus,
select:focus {
    border-color: #226450;
    box-shadow: 0 0 0 3px rgba(34, 100, 80, 0.1);
}

input:invalid:not(:placeholder-shown) {
    border-color: #dc2626;
}

input:valid:not(:placeholder-shown) {
    border-color: #16a34a;
}

/* Form Container */
.auth-form {
    animation: slideIn 0.3s ease-out;
}

.auth-form.hidden {
    display: none;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Buttons */
button[type="submit"],
button[type="button"] {
    transition: all 0.3s ease;
    cursor: pointer;
}

/* Only apply hover lift to auth form submit buttons, not all buttons */
#auth-modal button[type="submit"]:hover,
.auth-form button[type="submit"]:hover,
#signin-form button[type="submit"]:hover,
#signup-form button[type="submit"]:hover {
    transform: translateY(-2px);
}

#auth-modal button[type="submit"]:active,
.auth-form button[type="submit"]:active {
    transform: translateY(0);
}

/* Social Login Buttons */
#facebook-login,
#email-continue {
    display: flex;
    align-items: center;
    justify-content: center;
}

#facebook-login svg,
#email-continue svg {
    transition: transform 0.3s ease;
}

#facebook-login:hover svg,
#email-continue:hover svg {
    transform: scale(1.1);
}

/* Notification */
.notification {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* User Profile Section */
#user-profile {
    animation: fadeIn 0.3s ease-in-out;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    backdrop-filter: blur(10px);
}

/* Modal Position */
#auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    z-index: 50;
}

/* Close Button */
#close-auth-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

#close-auth-modal:hover {
    color: #374151;
}

/* Modal Content */
#auth-modal > div {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 640px) {
    #auth-modal > div {
        margin: 0.5rem;
        max-width: 100%;
        border-radius: 1rem;
    }

    #auth-modal {
        padding: 0.5rem;
    }

    /* Auth form inputs - larger touch targets on mobile */
    #auth-modal input[type="text"],
    #auth-modal input[type="email"],
    #auth-modal input[type="password"] {
        font-size: 16px; /* Prevents iOS zoom on focus */
        padding: 0.65rem 0.75rem;
        border-radius: 0.5rem;
    }

    /* Auth form buttons - larger touch targets */
    #auth-modal button[type="submit"],
    #auth-modal button[type="button"] {
        min-height: 44px;
        font-size: 14px;
    }

    /* Social login buttons compact */
    #facebook-login,
    #email-continue {
        padding: 0.6rem 1rem;
        font-size: 13px;
    }

    /* Modal close button - easier to tap */
    #close-auth-modal {
        top: 0.75rem;
        right: 0.75rem;
        min-width: 32px;
        min-height: 32px;
    }

    #user-profile {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.4rem 0.5rem;
        font-size: 13px;
    }

    #user-email {
        max-width: 100%;
        font-size: 12px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@media (max-width: 480px) {
    #auth-modal > div {
        margin: 0.25rem;
    }

    #auth-modal {
        padding: 0.25rem;
    }

    /* Even smaller spacing on very small screens */
    #auth-modal label {
        font-size: 13px;
        margin-bottom: 0.25rem;
    }
}

/* Loading State */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Accessibility */
input:focus-visible,
button:focus-visible,
select:focus-visible {
    outline: 2px solid #226450;
    outline-offset: 2px;
}

/* Form Labels */
label {
    display: block;
    font-weight: 600;
    color: #f3f4f6;
}

/* Error State */
input.error {
    border-color: #dc2626;
    background-color: rgba(220, 38, 38, 0.05);
}

input.error:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* Success State */
input.success {
    border-color: #16a34a;
    background-color: rgba(22, 163, 74, 0.05);
}

input.success:focus {
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}
