/**
 * Arthur UI Styles
 * Floating button, modal, notifications
 */

/* =============================================================================
   Floating Action Button
   ============================================================================= */

.arthur-fab {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    z-index: 1000;
    padding: 0;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.arthur-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.arthur-fab:active {
    transform: scale(0.95);
}

.arthur-fab-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .arthur-fab {
        bottom: 16px;
        left: 16px;
        width: 52px;
        height: 52px;
    }
}

/* =============================================================================
   Modal
   ============================================================================= */

.arthur-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s 0.3s, opacity 0.3s ease;
}

.arthur-modal-open {
    visibility: visible;
    opacity: 1;
    transition: visibility 0s, opacity 0.3s ease;
}

.arthur-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.arthur-modal-content {
    position: relative;
    background: #1a1a2e;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.arthur-modal-open .arthur-modal-content {
    transform: translateY(0);
}

.arthur-modal-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.arthur-modal-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    margin-right: 12px;
    transition: transform 0.3s ease;
}

.arthur-modal-title {
    flex: 1;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.arthur-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.arthur-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.arthur-modal-body {
    padding: 20px;
}

.arthur-input {
    width: 100%;
    min-height: 80px;
    padding: 12px 16px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.arthur-input:focus {
    outline: none;
    border-color: #667eea;
}

.arthur-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.arthur-char-count {
    text-align: right;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 8px;
}

.arthur-modal-footer {
    padding: 0 20px 20px;
}

.arthur-send-btn {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.arthur-send-btn:hover:not(:disabled) {
    transform: translateY(-2px);
}

.arthur-send-btn:active:not(:disabled) {
    transform: translateY(0);
}

.arthur-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.arthur-send-btn.arthur-sending .arthur-send-text {
    display: none;
}

.arthur-send-btn.arthur-sending .arthur-send-icon {
    animation: arthurPulse 1s ease-in-out infinite;
}

@keyframes arthurPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.arthur-status {
    padding: 12px 20px;
    margin: 0 20px 20px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
}

.arthur-status-pending {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.arthur-status-success {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.arthur-status-error {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

/* =============================================================================
   Notification Toast
   ============================================================================= */

.arthur-notification {
    position: fixed;
    bottom: 90px;
    left: 20px;
    max-width: 320px;
    padding: 12px 16px;
    background: #1a1a2e;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1500;
    animation: arthurSlideIn 0.3s ease;
}

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

.arthur-notification-fade {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.arthur-notif-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
}

.arthur-notif-text {
    flex: 1;
    font-size: 14px;
    color: #fff;
    line-height: 1.4;
}

.arthur-notif-close {
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.arthur-notif-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.arthur-notif-refresh {
    padding: 6px 12px;
    border: none;
    background: rgba(102, 126, 234, 0.3);
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.arthur-notif-refresh:hover {
    background: rgba(102, 126, 234, 0.5);
}

.arthur-notification-info {
    border-left: 3px solid #667eea;
}

.arthur-notification-success {
    border-left: 3px solid #4caf50;
}

.arthur-notification-error {
    border-left: 3px solid #f44336;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .arthur-notification {
        left: 16px;
        right: 16px;
        max-width: none;
        bottom: 80px;
    }
    
    .arthur-modal-content {
        width: 95%;
        margin: 0 auto;
    }
}

/* =============================================================================
   Arthur Thread Styles
   ============================================================================= */

.arthur-thread-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.arthur-thread-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.arthur-thread-name {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.arthur-thread-status {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.arthur-thinking-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    color: #667eea;
    font-size: 14px;
}

.arthur-thinking-dots {
    display: inline-flex;
    gap: 2px;
}

.arthur-thinking-dot {
    width: 6px;
    height: 6px;
    background: #667eea;
    border-radius: 50%;
    animation: arthurDotPulse 1.4s ease-in-out infinite;
}

.arthur-thinking-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.arthur-thinking-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes arthurDotPulse {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}
