/* Chatbot Authentication Styles */

/* Auth Modal Overlay */
.chatbot-auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001; /* Above chatbot widget */
    backdrop-filter: blur(5px);
}

/* Auth Modal Content */
.auth-modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Close Button */
.auth-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.auth-modal-close:hover {
    color: #333;
}

/* RTL Support for Close Button */
.auth-modal-content[dir="rtl"] .auth-modal-close {
    right: auto;
    left: 15px;
}

/* Auth Form */
.auth-form h3 {
    margin: 0 0 24px 0;
    font-size: 24px;
    color: #333;
    text-align: center;
}

.auth-form .form-group {
    margin-bottom: 16px;
}

.auth-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #555;
}

.auth-form input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.auth-form input:focus {
    outline: none;
    border-color: #007bff;
}

/* Submit Button */
.auth-submit-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 10px;
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.auth-submit-btn:active {
    transform: translateY(0);
}

/* Error Message */
.error-message {
    background: #fee;
    color: #c00;
    padding: 10px;
    border-radius: 6px;
    font-size: 14px;
    margin: 10px 0;
    border-left: 4px solid #c00;
}

/* Form Switch Link */
.auth-switch {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #666;
}

.auth-switch a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    margin-left: 5px;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* RTL Support for Switch Link */
.auth-modal-content[dir="rtl"] .auth-switch a {
    margin-left: 0;
    margin-right: 5px;
}

/* Auth Button in Chat Header */
.chatbot-header .auth-header-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.chatbot-header .auth-button {
    background: #667eea;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.chatbot-header .auth-button:hover {
    background: #5568d3;
}

/* Auth Info Display */
.auth-info-container {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #666;
}

.auth-user-name {
    font-weight: 600;
    color: #333;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-logout-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: background 0.2s;
}

.auth-logout-btn:hover {
    background: #c82333;
}

/* Loading Spinner (optional) */
.auth-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .auth-modal-content {
        padding: 20px;
        max-width: 90%;
    }

    .auth-form h3 {
        font-size: 20px;
    }

    .auth-form input {
        padding: 10px 12px;
        font-size: 14px;
    }

    .auth-submit-btn {
        padding: 10px;
        font-size: 14px;
    }
}
