/* Modal Styles for Signup and Login */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1050;
    overflow-y: auto;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    /* Enable scrolling on mobile */
    min-height: 100vh;
    /* Smooth scrolling */
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.modal.show {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    transition: opacity 0.3s;
    opacity: 0;
}

.modal.show .modal-overlay {
    opacity: 1;
}

.modal-container {
    position: relative;
    background-color: #000;
    border-radius: 0.75rem;
    max-width: 28rem;
    width: 100%;
    margin: 2rem auto;
    border: 1px solid rgba(53, 255, 0, 0.3);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.8), 0 8px 10px -6px rgba(0, 0, 0, 0.6);
    transform: scale(0.95) translateY(0.5rem);
    transition: all 0.4s ease;
    overflow: hidden;
    text-align: left;
    /* Ensure proper sizing on mobile */
    max-height: none;
    min-height: auto;
}

.modal.show .modal-container {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: #35FF00;
    background-color: rgba(0, 0, 0, 0.8);
    border: none;
    border-radius: 50%;
    padding: 0.25rem;
    transition: all 0.2s;
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 1px rgba(46, 204, 113, 0.2);
    width: 32px;
    height: 32px;
}

.modal-close:hover {
    color: #ffffff;
    background-color: #35FF00;
    transform: rotate(90deg);
}

.modal-close-icon {
    width: 1.35rem;
    height: 1.35rem;
}

.modal-content {
    padding: 1.5rem;
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
    background-color: #000;
}

.modal-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.modal-logo img {
    height: 90px;
    width: auto;
    border-radius: 8px;
}

.modal-title {
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    color: #35FF00;
    margin-bottom: 1.25rem;
}

.signup-error {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid #ef4444;
    color: #ef4444;
    padding: 0.85rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.signup-error::before {
    content: "!";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background-color: #ef4444;
    color: white;
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.8rem;
}

.signup-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.5rem;
}

.address-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(53, 255, 0, 0.2);
}

.address-section h4 {
    color: #35FF00;
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
    text-align: center;
    opacity: 0.9;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #35FF00;
    margin-bottom: 0.35rem;
}

.form-group .required {
    color: #ef4444;
}

.form-group input {
    display: block;
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: 1px solid rgba(46, 204, 113, 0.3);
    border-radius: 8px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-family: 'Poppins', sans-serif;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.form-group input:focus {
    outline: none;
    border-color: #35FF00;
    box-shadow: 0 0 0 2px rgba(53, 255, 0, 0.3);
    transform: translateY(0);
}

.validation-error {
    font-size: 0.75rem;
    color: #ef4444;
    margin-top: 0.4rem;
    font-weight: 500;
}

.form-submit {
    margin-top: 1.25rem;
}

.btn-signup-submit {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 0.9rem 1rem;
    border: none;
    border-radius: 50px; /* Full rounded buttons like your current design */
    background-color: #35FF00;
    color: #000;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(53, 255, 0, 0.3);
    letter-spacing: 0.5px;
}

.btn-signup-submit:hover {
    background-color: #28CC00;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(53, 255, 0, 0.4);
}

.btn-signup-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.loading-spinner {
    animation: spin 1s linear infinite;
    height: 1rem;
    width: 1rem;
    margin-right: 0.5rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-spinner {
    animation: spin 1s linear infinite;
    height: 1.2rem;
    width: 1.2rem;
    margin-right: 0.5rem;
}

.spinner-track {
    opacity: 0.25;
}

.spinner-path {
    opacity: 0.9;
}

.login-option {
    margin-top: 1.75rem;
}

.separator {
    position: relative;
    text-align: center;
    margin: 1rem 0;
}

.separator::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    border-top: 1px solid rgba(46, 204, 113, 0.3);
}

.separator span {
    position: relative;
    display: inline-block;
    background-color: #000;
    padding: 0 0.75rem;
    color: #35FF00;
    font-size: 0.85rem;
}

.btn-switch-login {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: transparent;
    color: #35FF00;
    border: 1px solid rgba(53, 255, 0, 0.5);
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.btn-switch-signup {
    width: 100%;
    padding: 0.65rem 1rem;
    background-color: transparent;
    color: #35FF00;
    border: 1px solid rgba(53, 255, 0, 0.5);
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.btn-switch-login:hover,
.btn-switch-signup:hover {
    background-color: rgba(46, 204, 113, 0.1);
    border-color: rgba(46, 204, 113, 0.7);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.2);
}

/* Login Modal Specific Styles */
.login-error {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid #ef4444;
    color: #ef4444;
    padding: 0.85rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.login-error::before {
    content: "!";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background-color: #ef4444;
    color: white;
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.8rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.remember-forgot-container {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin: 0.25rem 0;
    width: 100%;
}

.remember-me {
    display: flex;
    align-items: center;
    text-align: left;
}

.forgot-container {
    text-align: right;
}

.remember-me input[type="checkbox"] {
    margin-right: 0.25rem;
    accent-color: #35FF00;
    cursor: pointer;
    height: 0.9rem;
    width: 0.9rem;
    border-radius: 3px;
    border-color: rgba(53, 255, 0, 0.5);
    position: relative;
    top: -1px;
}

.remember-me label {
    font-size: 0.85rem;
    color: #35FF00;
    cursor: pointer;
    text-align: left;
}

.forgot-password {
    font-size: 0.85rem;
    color: #35FF00;
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 500;
    white-space: nowrap;
}

.forgot-password:hover {
    text-decoration: underline;
    color: #28CC00;
}

.btn-login-submit {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 0.8rem 1rem;
    border: none;
    border-radius: 50px;
    background-color: #35FF00;
    color: #000;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(53, 255, 0, 0.3);
    letter-spacing: 0.5px;
}

.btn-login-submit:hover {
    background-color: #28CC00;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(53, 255, 0, 0.4);
}

.btn-login-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.admin-login {
    text-align: center;
    margin-top: 0.25rem;
    margin-bottom: 0;
}

.admin-login p {
    font-size: 0.75rem;
    color: rgba(53, 255, 0, 0.7);
    margin-bottom: 0.15rem;
}

.admin-link {
    color: #35FF00;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    font-size: 0.8rem;
}

.admin-link:hover {
    text-decoration: underline;
    color: #28CC00;
}

.admin-login:hover {
    background-color: rgba(53, 255, 0, 0.08);
    border-color: #444;
}

/* Additional styling for icons and buttons */
.btn-text i, 
.admin-link i,
.btn-switch-login i,
.btn-switch-signup i {
    margin-right: 0.5rem;
}

/* Password input styling */

/* Hover effects for form inputs */
.form-group input:hover {
    border-color: rgba(46, 204, 113, 0.5);
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.1);
}

/* Animation for button loading state */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.02);
        opacity: 0.9;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.btn-loading {
    animation: pulse 1.2s infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    font-weight: 500;
}

/* Button click effect */
.btn-login-submit:active,
.btn-signup-submit:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.2);
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .modal {
        align-items: flex-start;
        padding: 0.5rem 0.5rem;
        padding-top: 1rem;
        padding-bottom: 2rem;
    }
    
    .modal-container {
        max-width: 95%;
        border-radius: 0.75rem;
        margin: 0.5rem auto;
        margin-bottom: 2rem;
        /* Remove centering constraints on mobile */
        position: relative;
        transform: none;
        /* Ensure it can scroll properly */
        max-height: none;
        overflow: visible;
    }
    
    .modal.show .modal-container {
        transform: none;
    }
    
    .modal-content {
        padding: 1.25rem;
        /* Allow content to flow naturally */
        max-height: none;
        overflow: visible;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .modal-title {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .modal-logo {
        margin-bottom: 1rem;
    }
    
    .modal-logo img {
        height: 70px;
    }
    
    .btn-login-submit,
    .btn-signup-submit,
    .btn-switch-login,
    .btn-switch-signup {
        padding: 0.8rem 0.75rem;
    }
    
    .form-group label {
        font-size: 0.8rem;
    }
      .remember-me label,
    .forgot-password {
        font-size: 0.75rem;
    }
    
    .remember-forgot-container {
        flex-direction: row;
        gap: 0.75rem;
    }
}

@media (max-width: 400px) {
    .modal {
        padding: 0.25rem;
        padding-top: 0.5rem;
        padding-bottom: 1rem;
    }
    
    .modal-container {
        max-width: 98%;
        border-radius: 0.5rem;
        margin: 0.25rem auto;
    }
    
    .modal-content {
        padding: 1rem;
    }
    
    .modal-title {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }
    
    .modal-logo {
        margin-bottom: 0.75rem;
    }
    
    .modal-logo img {
        height: 60px;
    }
    
    .remember-forgot-container {
        gap: 0.5rem;
    }
    
    .forgot-password {
        font-size: 0.7rem;
    }
    
    .remember-me label {
        font-size: 0.7rem;
    }
    
    .signup-form,
    .login-form {
        gap: 0.75rem;
    }
    
    .form-group {
        margin-bottom: 0.25rem;
    }
}

/* Handle landscape orientation on mobile devices */
@media (max-width: 768px) and (max-height: 500px) and (orientation: landscape) {
    .modal {
        align-items: flex-start;
        padding: 0.25rem;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
    
    .modal-container {
        margin-top: 0.25rem;
        margin-bottom: 0;
        max-width: 90%;
    }
    
    .modal-content {
        padding: 0.75rem;
    }
    
    .modal-title {
        font-size: 1.125rem;
        margin-bottom: 0.5rem;
    }
    
    .modal-logo {
        margin-bottom: 0.5rem;
    }
    
    .modal-logo img {
        height: 50px;
    }
    
    .signup-form,
    .login-form {
        gap: 0.5rem;
    }
    
    .form-group {
        margin-bottom: 0.125rem;
    }
    
    .form-row {
        gap: 0.5rem;
    }
}

/* Handle very short screens - ensure modal is always scrollable */
@media (max-height: 600px) {
    .modal {
        align-items: flex-start !important;
        padding: 0.5rem !important;
        padding-top: 0.5rem !important;
        overflow-y: auto !important;
    }
    
    .modal-container {
        margin: 0.5rem auto !important;
        margin-bottom: 1rem !important;
        position: relative;
        transform: none !important;
    }
    
    .modal.show .modal-container {
        transform: none !important;
    }
}

/* Handle extremely short screens */
@media (max-height: 450px) {
    .modal {
        padding: 0.25rem !important;
        padding-top: 0.25rem !important;
    }
    
    .modal-container {
        margin: 0.25rem auto !important;
        max-width: 98% !important;
    }
    
    .modal-content {
        padding: 0.75rem !important;
    }
    
    .modal-title {
        font-size: 1.125rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .modal-logo {
        margin-bottom: 0.5rem !important;
    }    .modal-logo img {
        height: 40px !important;
    }
}
