/* Auth Popup CSS */

/* Auth Status Bar */
.auth-status {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.auth-buttons {
    display: flex;
    gap: 10px;
}

.auth-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.login-btn {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.3);
}

.login-btn:hover {
    background: rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

.register-btn {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.3);
}

.register-btn:hover {
    background: rgba(34, 197, 94, 0.3);
    transform: translateY(-1px);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 10px 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.welcome-text {
    color: #e8e8e8;
    font-size: 0.9rem;
}

.user-btn {
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid;
}

.user-btn:not(.logout) {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.3);
}

.user-btn:not(.logout):hover {
    background: rgba(59, 130, 246, 0.3);
}

.user-btn.logout {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.user-btn.logout:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* Popup Overlay */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Popup Modal */
.popup-modal {
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease-out;
    position: relative;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Popup Header */
.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.popup-header h2 {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Popup Content */
.popup-content {
    padding: 25px 30px 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #ffffff;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.form-group input:focus {
    outline: none;
    border-color: #3b82f6;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input:valid {
    border-color: #22c55e;
}

.form-group input:invalid:not(:placeholder-shown) {
    border-color: #ef4444;
}

.form-help {
    display: block;
    margin-top: 6px;
    font-size: 0.75rem;
    color: #9ca3af;
    transition: color 0.3s ease;
}

/* Form Actions */
.form-actions {
    margin: 25px 0 20px;
}

.submit-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    position: relative;
    overflow: hidden;
}

.submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Popup Footer */
.popup-footer {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.popup-footer p {
    color: #9ca3af;
    font-size: 0.9rem;
    margin: 0;
}

.popup-footer a {
    color: #60a5fa;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.popup-footer a:hover {
    color: #3b82f6;
    text-decoration: underline;
}

/* Toast Notification */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.toast-icon {
    font-size: 1.2rem;
    font-weight: bold;
}

.toast-message {
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 500;
}

.toast-close {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 2px;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* Toast Types */
.toast-success {
    border-color: rgba(34, 197, 94, 0.3);
}

.toast-success .toast-icon {
    color: #22c55e;
}

.toast-error {
    border-color: rgba(239, 68, 68, 0.3);
}

.toast-error .toast-icon {
    color: #ef4444;
}

.toast-info {
    border-color: rgba(59, 130, 246, 0.3);
}

.toast-info .toast-icon {
    color: #60a5fa;
}

/* Loading State */
.submit-btn.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.submit-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-left: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .auth-status {
        top: 15px;
        right: 15px;
    }

    .auth-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .auth-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    .user-menu {
        flex-direction: column;
        gap: 8px;
        padding: 8px 12px;
    }

    .popup-modal {
        width: 95%;
        margin: 20px;
    }

    .popup-header {
        padding: 20px 25px 15px;
    }

    .popup-header h2 {
        font-size: 1.3rem;
    }

    .popup-content {
        padding: 20px 25px 25px;
    }

    .toast {
        min-width: 280px;
        margin: 0 20px;
    }
}

@media (max-width: 480px) {
    .auth-status {
        top: 10px;
        right: 10px;
    }

    .popup-modal {
        width: 100%;
        height: 100%;
        border-radius: 0;
        margin: 0;
    }

    .popup-header {
        padding: 15px 20px 12px;
    }

    .popup-header h2 {
        font-size: 1.2rem;
    }

    .popup-content {
        padding: 15px 20px 20px;
    }

    .form-group input {
        padding: 10px 14px;
    }

    .submit-btn {
        padding: 12px 16px;
    }

    .toast {
        min-width: auto;
        left: 20px;
        right: 20px;
        transform: translateY(-100px);
    }

    .toast.show {
        transform: translateY(0);
    }
}

/* Dark scrollbar for popups */
.popup-modal::-webkit-scrollbar {
    width: 6px;
}

.popup-modal::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.popup-modal::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.5);
    border-radius: 3px;
}

.popup-modal::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.7);
}

/* Focus styles for accessibility */
.popup-modal *:focus {
    outline: 2px solid rgba(59, 130, 246, 0.5);
    outline-offset: 2px;
}

.close-btn:focus {
    outline: 2px solid rgba(239, 68, 68, 0.5);
}

/* Animation delays for staggered effect */
.form-group:nth-child(1) {
    animation-delay: 0.1s;
}

.form-group:nth-child(2) {
    animation-delay: 0.2s;
}

.form-group:nth-child(3) {
    animation-delay: 0.3s;
}

.form-actions {
    animation-delay: 0.4s;
}

.popup-footer {
    animation-delay: 0.5s;
}

/* Smooth transitions for form validation */
.form-group input {
    transition: border-color 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Enhanced focus ring */
.form-group input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Success state */
.form-group input.success {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.05);
}

/* Error state */
.form-group input.error {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

/* Popup entrance animation variants */
.popup-overlay.fast-fade {
    animation: fadeIn 0.2s ease-out;
}

.popup-modal.bounce-in {
    animation: bounceIn 0.4s ease-out;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    60% {
        opacity: 1;
        transform: translateY(-5px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}