/* ============================================
   Liquid Glass Effects
   ============================================ */

/* Glass Panel - Main container effect */
.glass-panel {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-lg);
    box-shadow: 
        0 8px 32px rgba(0, 115, 230, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 0 rgba(0, 0, 0, 0.02);
}

/* Glass Card - Smaller elements */
.glass-card {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-md);
    box-shadow: 
        0 4px 16px rgba(0, 115, 230, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transition: all var(--transition-base);
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 
        0 8px 24px rgba(0, 115, 230, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* Glass Input */
.glass-input {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 0.95rem;
    color: var(--gray-800);
    transition: all var(--transition-base);
    outline: none;
}

.glass-input::placeholder {
    color: var(--gray-400);
}

.glass-input:focus {
    background: rgba(255, 255, 255, 0.8);
    border-color: var(--primary-300);
    box-shadow: 
        0 0 0 3px rgba(0, 115, 230, 0.1),
        0 4px 12px rgba(0, 115, 230, 0.08);
}

/* Glass Button */
.glass-btn {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.glass-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: var(--white);
    border: none;
    box-shadow: 0 4px 15px rgba(0, 115, 230, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    box-shadow: 0 6px 20px rgba(0, 115, 230, 0.4);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: var(--white);
    border: none;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: var(--white);
    border: none;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
    transform: translateY(-1px);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.2rem;
    color: var(--gray-600);
}

.btn-icon:hover {
    background: rgba(0, 115, 230, 0.1);
    color: var(--primary-600);
}

.btn-icon.danger:hover {
    background: var(--danger-light);
    color: var(--danger);
}

/* Gradient Orbs - Background decoration */
.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0, 115, 230, 0.3) 0%, transparent 70%);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(99, 179, 237, 0.25) 0%, transparent 70%);
    bottom: -150px;
    left: -150px;
    animation-delay: -7s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(147, 197, 253, 0.3) 0%, transparent 70%);
    top: 40%;
    left: 30%;
    animation-delay: -14s;
}

/* Frosted glass effect for scrollable areas */
.chat-messages::-webkit-scrollbar,
.chat-list::-webkit-scrollbar,
.document-list::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track,
.chat-list::-webkit-scrollbar-track,
.document-list::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb,
.chat-list::-webkit-scrollbar-thumb,
.document-list::-webkit-scrollbar-thumb {
    background: rgba(0, 115, 230, 0.2);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover,
.chat-list::-webkit-scrollbar-thumb:hover,
.document-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 115, 230, 0.4);
}

/* Selection highlight */
::selection {
    background: rgba(0, 115, 230, 0.2);
    color: var(--gray-900);
}

/* Focus ring for accessibility */
*:focus-visible {
    outline: 2px solid var(--primary-400);
    outline-offset: 2px;
}

/* Shimmer effect for loading states */
.shimmer {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.5) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Message typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: var(--space-md);
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-400);
    animation: bounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

/* Status indicator with text - compact chip design */
.status-indicator {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.25rem;
    margin: 0.5rem 0;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.85) 100%);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 115, 230, 0.15), 
                0 0 0 1px rgba(255, 255, 255, 0.6),
                inset 0 1px 2px rgba(255, 255, 255, 0.8);
    max-width: fit-content;
    transition: all 0.3s ease;
}

.status-indicator .typing-indicator {
    padding: 0;
    margin: 0;
    flex-shrink: 0;
    gap: 3px;
}

.status-indicator .typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--primary-400);
}

.status-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primary-700);
    white-space: nowrap;
    letter-spacing: 0.02em;
    min-width: 220px;
    text-align: left;
}

@keyframes status-gradient {
    0% {
        background-position: 0% 0%;
    }
    50% {
        background-position: 100% 0%;
    }
    100% {
        background-position: 0% 0%;
    }
}

/* Pulse effect for status indicator */
.status-indicator {
    animation: status-pulse 2s ease-in-out infinite;
}

@keyframes status-pulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(0, 115, 230, 0.15), 
                    0 0 0 1px rgba(255, 255, 255, 0.6),
                    inset 0 1px 2px rgba(255, 255, 255, 0.8);
    }
    50% {
        box-shadow: 0 6px 24px rgba(0, 115, 230, 0.2), 
                    0 0 0 1px rgba(255, 255, 255, 0.7),
                    inset 0 1px 2px rgba(255, 255, 255, 0.9);
    }
}

/* Status indicator: smooth fade-out after response is shown */
.message.status-fade-out {
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
}
.message.status-fade-out .status-indicator {
    animation: none;
}

/* Pulse effect for notifications */
.pulse {
    animation: pulse 2s infinite;
}

/* Ripple effect for buttons */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.btn:active::after {
    width: 200px;
    height: 200px;
}
