/**
 * Agent Floating Icon and Panel Styles
 * ZAW-IAM Agent Module - Phase 1
 * Features: Forget Password, Modify Password
 */

/* Floating Icon Container */
#agent-floating-icon {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    cursor: pointer;
    transition: all 0.3s ease;
}

#agent-floating-icon:hover {
    transform: scale(1.1);
}

#agent-floating-icon.hidden {
    display: none;
}

/* Floating Icon Button */
.agent-icon-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    transition: all 0.3s ease;
    border: none;
    outline: none;
}

.agent-icon-button:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.agent-icon-button:active {
    transform: scale(0.95);
}

/* Agent Panel Overlay */
#agent-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#agent-panel-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

/* Agent Panel */
#agent-panel {
    width: 420px;
    max-width: 90vw;
    max-height: 85vh;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.3s ease;
}

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

/* Panel Header */
.agent-panel-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.agent-panel-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.agent-panel-header .close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.agent-panel-header .close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Panel Body */
.agent-panel-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* Feature Selection (Home View) */
.agent-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.agent-feature-btn {
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.agent-feature-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateX(5px);
}

.agent-feature-btn .icon {
    font-size: 24px;
    width: 40px;
    text-align: center;
}

.agent-feature-btn .text h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    color: #333;
}

.agent-feature-btn .text p {
    margin: 0;
    font-size: 13px;
    color: #666;
}

/* Forms */
.agent-form {
    display: none;
}

.agent-form.active {
    display: block;
}

.agent-form .form-group {
    margin-bottom: 16px;
}

.agent-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.agent-form input[type="email"],
.agent-form input[type="password"],
.agent-form input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.agent-form input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.agent-form .input-with-button {
    display: flex;
    gap: 8px;
}

.agent-form .input-with-button input {
    flex: 1;
}

.agent-form .btn-send-code {
    padding: 10px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
    transition: background 0.2s;
}

.agent-form .btn-send-code:hover {
    background: #5568d3;
}

.agent-form .btn-send-code:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Buttons */
.agent-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    margin-top: 8px;
}

.agent-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.agent-btn-primary:hover {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.agent-btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.agent-btn-secondary:hover {
    background: #e0e0e0;
}

/* Back Button */
.agent-back-btn {
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    font-size: 14px;
    padding: 8px 0;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.agent-back-btn:hover {
    color: #5568d3;
}

/* Messages */
.agent-message {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
    display: none;
}

.agent-message.active {
    display: block;
}

.agent-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.agent-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.agent-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Loading Spinner */
.agent-loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.agent-loading.active {
    display: block;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Password Rules */
.password-rules {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    font-size: 12px;
    color: #666;
    margin-top: 12px;
}

.password-rules h5 {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #333;
}

.password-rules ul {
    margin: 0;
    padding-left: 20px;
}

.password-rules li {
    margin-bottom: 4px;
}

/* Responsive */
@media (max-width: 480px) {
    #agent-panel {
        width: 95vw;
        max-height: 90vh;
    }

    .agent-icon-button {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }

    #agent-floating-icon {
        bottom: 20px;
        right: 20px;
    }
}
