/* Authentication Modal Styles */

/* Auth Modal Overlay - hidden by default */
.auth-modal-overlay {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
}

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

.auth-modal-content {
    background: white;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    position: relative;
}

.close-auth-modal {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    z-index: 10;
}

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

.auth-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 10px;
    width: 90%;
    max-width: 380px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.3s ease;
    position: relative;
}

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

.modal-header {
    background: linear-gradient(135deg, #2B5A9E 0%, #4A90E2 100%);
    color: white;
    padding: 1.15rem 1.5rem;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

.close-modal {
    color: white;
    font-size: 1.6rem;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.close-modal:hover {
    transform: scale(1.2);
}

.modal-body {
    padding: 1.5rem;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

/* Form Styles */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    color: #2c3e50;
    font-weight: 600;
    font-size: 0.8rem;
}

.form-group input {
    padding: 0.6rem 0.85rem;
    border: 2px solid #e0e0e0;
    border-radius: 7px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #2B5A9E;
    box-shadow: 0 0 0 3px rgba(43, 90, 158, 0.1);
}

.form-group input::placeholder {
    color: #999;
}

.form-group select {
    padding: 0.6rem 0.85rem;
    border: 2px solid #e0e0e0;
    border-radius: 7px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    background: white;
    color: #333;
    cursor: pointer;
}

.form-group select:focus {
    outline: none;
    border-color: #2B5A9E;
    box-shadow: 0 0 0 3px rgba(43, 90, 158, 0.1);
}

.forgot-password {
    text-align: right;
    margin-top: -0.4rem;
}

.forgot-password a {
    color: #2B5A9E;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
}

.forgot-password a:hover {
    text-decoration: underline;
}

.submit-btn {
    background: linear-gradient(135deg, #2B5A9E 0%, #4A90E2 100%);
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 7px;
    transition: all 0.3s ease;
    margin-top: 0.4rem;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(43, 90, 158, 0.4);
}

.form-footer {
    text-align: center;
    margin-top: 1.15rem;
    padding-top: 1.15rem;
    border-top: 1px solid #e0e0e0;
    color: #666;
    font-size: 0.85rem;
}

.form-footer a {
    color: #2B5A9E;
    text-decoration: none;
    font-weight: 600;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* User Menu (when logged in) */
.user-menu {
    display: none;
    position: relative;
}

.user-menu.active {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    padding: 0.4rem 0.85rem;
    border-radius: 7px;
    transition: background 0.3s ease;
}

.user-info:hover {
    background: #f8f9fa;
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2B5A9E 0%, #4A90E2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
}

.user-name {
    color: #2c3e50;
    font-weight: 600;
    font-size: 0.8rem;
}

.dropdown-arrow {
    color: #666;
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.user-info.active .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    min-width: 170px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    border-radius: 7px;
    overflow: hidden;
    margin-top: 0.4rem;
    z-index: 1000;
}

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

.user-dropdown a,
.user-dropdown button {
    display: block;
    width: 100%;
    padding: 0.7rem 1rem;
    color: #2c3e50;
    text-decoration: none;
    border: none;
    background: none;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
}

.user-dropdown a:hover,
.user-dropdown button:hover {
    background: #f1f1f1;
}

.user-dropdown .logout-btn {
    color: #dc3545;
    border-top: 1px solid #e0e0e0;
}

/* Settings notification badge */
.user-dropdown a {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.settings-badge {
    background: #e53935;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
    margin-left: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .modal-header {
        padding: 1.25rem 1.5rem;
    }

    .modal-header h2 {
        font-size: 1.25rem;
    }
}

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

    .modal-body {
        padding: 1rem;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-header {
        padding: 1rem;
        position: sticky;
        top: 0;
        background: white;
        z-index: 1;
    }

    .modal-header h2 {
        font-size: 1.1rem;
    }

    .close-modal {
        width: 36px;
        height: 36px;
        font-size: 1.5rem;
    }
}
