/* ========================================
   Oracle HCM Chat Assistant - Premium Styles
   ======================================== */

:root {
    /* EQInt Brand Colors */
    --primary-color: #00d4aa;
    --primary-dark: #00b890;
    --primary-light: #00f9c8;
    --secondary-color: #5b86e5;
    --accent-color: #36d1dc;

    /* Semantic Colors */
    --success-color: #00d4aa;
    --warning-color: #ffa726;
    --error-color: #ef5350;
    --info-color: #42a5f5;

    /* Neutral Colors */
    --bg-primary: #0a0e1a;
    --bg-secondary: #12182b;
    --bg-tertiary: #1a2237;
    --bg-card: rgba(26, 34, 55, 0.6);
    --bg-hover: rgba(255, 255, 255, 0.05);
    --bg-hover-strong: rgba(255, 255, 255, 0.1);
    --scrollbar-track: rgba(255, 255, 255, 0.02);
    --scrollbar-thumb: rgba(255, 255, 255, 0.1);
    --scrollbar-thumb-hover: rgba(255, 255, 255, 0.15);
    --border-light: rgba(255, 255, 255, 0.15);
    --modal-bg: rgba(18, 24, 43, 0.95);
    --input-disabled: rgba(255, 255, 255, 0.1);
    --input-disabled-text: rgba(255, 255, 255, 0.4);
    --modal-overlay: rgba(0, 0, 0, 0.7);

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    --text-muted: #718096;

    /* Border & Shadow */
    --border-color: rgba(255, 255, 255, 0.08);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.35);
    --shadow-glow: 0 0 20px rgba(0, 212, 170, 0.3);

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

:root[data-theme="light"] {
    --bg-primary: #f1f5f9;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-hover: rgba(0, 0, 0, 0.05);
    --bg-hover-strong: rgba(0, 0, 0, 0.1);
    --scrollbar-track: rgba(0, 0, 0, 0.02);
    --scrollbar-thumb: rgba(0, 0, 0, 0.1);
    --scrollbar-thumb-hover: rgba(0, 0, 0, 0.15);
    --border-light: rgba(0, 0, 0, 0.1);
    --modal-bg: rgba(255, 255, 255, 0.95);
    --input-disabled: rgba(0, 0, 0, 0.05);
    --input-disabled-text: rgba(0, 0, 0, 0.4);
    --modal-overlay: rgba(0, 0, 0, 0.4);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --border-color: rgba(0, 0, 0, 0.1);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px rgba(0, 212, 170, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-tertiary) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Premium Success Card */
.chat-success-card {
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.1) 0%, rgba(91, 134, 229, 0.1) 100%);
    border: 1px solid rgba(0, 212, 170, 0.3);
    border-radius: 8px;
    padding: var(--spacing-md);
    margin: var(--spacing-md) 0;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md), 0 0 20px rgba(0, 212, 170, 0.1);
    animation: successCardEntry 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

@media (max-width: 400px) {
    .chat-success-card {
        padding: var(--spacing-md);
    }
}

.chat-success-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(0, 212, 170, 0.1) 0%, transparent 70%);
    animation: rotateGlow 10s linear infinite;
    pointer-events: none;
}

@keyframes successCardEntry {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes rotateGlow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.chat-success-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.chat-success-icon {
    width: 48px;
    height: 48px;
    background: var(--success-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 0 15px rgba(0, 212, 170, 0.5);
    animation: iconPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.5) 0.3s both;
}

@keyframes iconPop {
    from {
        transform: scale(0) rotate(-45deg);
        opacity: 0;
    }

    to {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

.chat-success-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

@media (max-width: 400px) {
    .chat-success-title {
        font-size: 16px;
    }
}

.chat-success-details {
    display: grid;
    gap: 6px;
    background: rgba(0, 0, 0, 0.25);
    padding: 10px 12px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-success-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

@media (max-width: 400px) {
    .chat-success-row {
        flex-direction: column;
        justify-content: flex-start;
        gap: 2px;
    }
}

.chat-success-label {
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.3px;
    font-weight: 600;
}

.chat-success-value {
    color: var(--text-primary);
    font-weight: 600;
}

.chat-success-footer {
    margin-top: 10px;
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 50%, rgba(0, 212, 170, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(91, 134, 229, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(54, 209, 220, 0.1) 0%, transparent 50%);
    animation: bgPulse 15s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes bgPulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 0.8;
    }
}

/* ========================================
   Chat Container
   ======================================== */

.chat-container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 5vh auto;
    height: 90vh;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-color);
    overflow: hidden; /* Fix: prevents container from expanding and pushing input down */
}

#chat-view-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
}

/* ========================================
   Header
   ======================================== */

.chat-header-bar {
    position: relative;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg) var(--spacing-sm) var(--spacing-lg) var(--spacing-lg);
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.1) 0%, rgba(91, 134, 229, 0.1) 100%);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.chat-header-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.chat-lang-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
}

.chat-lang-btn:hover {
    background: var(--bg-hover-strong);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.chat-lang-btn .material-icons-round {
    font-size: 18px;
}

/* RTL Support */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] .chat-header-left {
    flex-direction: row-reverse;
}

[dir="rtl"] .chat-header-info {
    text-align: right;
}

[dir="rtl"] .chat-status-indicator {
    flex-direction: row-reverse;
}

[dir="rtl"] .chat-quick-actions h3 {
    text-align: right;
}

[dir="rtl"] .chat-action-chips {
    flex-direction: row-reverse;
}

[dir="rtl"] .chat-message-content {
    text-align: right;
}

[dir="rtl"] .chat-welcome-message,
[dir="rtl"] .chat-typing-indicator,
[dir="rtl"] .message.bot {
    flex-direction: row-reverse;
}

[dir="rtl"] .chat-input-wrapper {
    flex-direction: row-reverse;
}

[dir="rtl"] .chat-send-btn {
    transform: scaleX(-1);
}

[dir="rtl"] .chat-send-btn:hover {
    transform: scaleX(-1) translateY(-2px);
}

[dir="rtl"] .chat-input-hint {
    text-align: right;
}

[dir="rtl"] .modal-header {
    flex-direction: row-reverse;
}

[dir="rtl"] .form-field label,
.form-group label {
    text-align: right;
}

[dir="rtl"] .modal-actions {
    flex-direction: row-reverse;
}

[dir="rtl"] .attachment-info {
    flex-direction: row-reverse;
}

[dir="rtl"] .chat-bot-avatar {
    margin-left: initial;
}


.header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.header-logo-wrapper {
    min-width: 52px;
    max-width: 140px;
    height: 52px;
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform var(--transition-base);
}

.header-logo-wrapper:hover {
    transform: scale(1.05);
}

.header-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.header-info h1 {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-dot.active {
    background: var(--success-color);
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 0 8px var(--success-color);
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

.header-actions {
    display: flex;
    gap: 10px;
    transform: translateX(4px);
}

.icon-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    background: var(--bg-hover);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
}

.icon-btn:hover {
    background: var(--bg-hover-strong);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.icon-btn .material-icons-round {
    font-size: 20px;
}

.icon-btn.recording {
    color: var(--error-color);
    background: rgba(239, 83, 80, 0.1);
    animation: micPulse 1.5s infinite;
}

/* Support Mode Button */
.support-mode-btn {
    position: relative;
}

.support-mode-btn:hover {
    color: #6366f1;
    border-color: rgba(99, 102, 241, 0.4);
}

.icon-btn.support-mode-active {
    color: #6366f1 !important;
    background: rgba(99, 102, 241, 0.15) !important;
    border: 1px solid rgba(99, 102, 241, 0.4);
    animation: supportPulse 2s ease-in-out infinite;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
}

@keyframes supportPulse {

    0%,
    100% {
        box-shadow: 0 0 8px rgba(99, 102, 241, 0.3);
    }

    50% {
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.6);
    }
}

/* ── Support Mode Bot Avatar — Hexagonal Badge ── */
.support-avatar-wrap {
    position: relative;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: supportAvatarPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Outer pulsing ring */
.support-avatar-wrap::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: conic-gradient(#6366f1, #818cf8, #4f46e5, #6366f1);
    animation: supportRingSpin 3s linear infinite;
    z-index: 0;
}

/* Mask to make the ring look like a border */
.support-avatar-wrap::after {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    background: var(--bg-secondary, #1a1a2e);
    z-index: 1;
}

@keyframes supportRingSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.support-avatar {
    position: relative;
    z-index: 2;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.6);
    clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
    overflow: visible;
}

.support-avatar svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}

@keyframes supportAvatarPop {
    0% {
        transform: scale(0.3) rotate(-15deg);
        opacity: 0;
    }

    70% {
        transform: scale(1.1) rotate(3deg);
        opacity: 1;
    }

    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes micPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 83, 80, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(239, 83, 80, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 83, 80, 0);
    }
}

/* ========================================
   Quick Actions
   ======================================== */

.quick-actions {
    padding: 0 0 var(--spacing-md) 0;
    border-bottom: none;
    background: transparent;
}

.quick-actions h3 {
    display: none;
}

.action-chips {
    display: flex;
    overflow-x: auto;
    gap: var(--spacing-md);
    padding-bottom: 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) transparent;
}

.action-chips::-webkit-scrollbar {
    height: 6px;
}

.action-chips::-webkit-scrollbar-track {
    background: transparent;
}

.action-chips::-webkit-scrollbar-thumb {
    background-color: var(--border-light);
    border-radius: 10px;
}

.action-chip {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 12px 18px;
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.15), rgba(91, 134, 229, 0.15));
    border: 1px solid rgba(0, 212, 170, 0.4);
    border-radius: var(--radius-xl);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 4px 12px var(--bg-hover-strong);
}

.action-chip:hover {
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.3), rgba(91, 134, 229, 0.3));
    border-color: var(--primary-light);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 212, 170, 0.25);
}

.action-chip .material-icons-round {
    font-size: 18px;
}

/* ========================================
   Chat Messages
   ======================================== */

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: var(--radius-sm);
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* Welcome Message */
.welcome-message {
    display: flex;
    gap: var(--spacing-md);
    align-items: flex-start;
    animation: slideIn 0.5s ease-out;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bot-avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: var(--shadow-glow);
}

.bot-avatar .material-icons-round {
    font-size: 24px;
    color: white;
}

.message-content {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-xl);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border-color);
    max-width: 75%;
    box-shadow: var(--shadow-sm);
}

.message-content p {
    margin-bottom: var(--spacing-sm);
    line-height: 1.6;
    color: var(--text-primary);
}

.message-content p:last-child {
    margin-bottom: 0;
}

/* Bot Message */
.message.bot {
    display: flex;
    gap: var(--spacing-md);
    align-items: flex-start;
    animation: slideIn 0.5s ease-out;
}

/* User Message */
.message.user {
    display: flex;
    justify-content: flex-end;
    animation: slideIn 0.5s ease-out;
}

.message.user .message-content {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    border-bottom-right-radius: 4px;
    color: #ffffff;
    max-width: 75%;
    box-shadow: 0 4px 15px rgba(0, 212, 170, 0.2);
}

.user-avatar {
    width: 44px;
    height: 44px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
    /* vertically center avatar with dots */
    padding: 0 0 4px 0;
}

.typing-indicator .bot-avatar,
.typing-indicator .google-ai-avatar,
.typing-indicator .support-avatar-wrap {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.typing-indicator.hidden {
    display: none;
}

.typing-dots {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: typingDot 1.4s infinite;
}

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

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {

    0%,
    60%,
    100% {
        opacity: 0.3;
        transform: translateY(0);
    }

    30% {
        opacity: 1;
        transform: translateY(-6px);
    }
}

/* ========================================
   Input Area
   ======================================== */

.chat-input-area {
    padding: 16px 20px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    flex-shrink: 0; /* Fix: ensures input area doesn't squash */
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 8px var(--spacing-md);
    transition: all var(--transition-base);
    box-shadow: 0 4px 20px var(--bg-hover-strong);
}

.input-wrapper:focus-within {
    border-color: var(--primary-color);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.2), 0 4px 20px var(--bg-hover-strong);
}

.chat-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    padding: 8px;
}

.chat-input::placeholder {
    color: var(--text-muted);
}

.send-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: var(--radius-full);
    color: white;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.4);
}

.send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--bg-hover-strong);
    box-shadow: none;
    color: var(--input-disabled-text);
}

.send-btn:not(:disabled):hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 212, 170, 0.6);
}

.input-hint {
    margin-top: var(--spacing-sm);
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

.input-hint kbd {
    background: var(--bg-hover-strong);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
}

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

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-overlay);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease-out;
}

.modal.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--modal-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--bg-hover-strong);
    border-radius: var(--radius-xl);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.close-btn {
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition-base);
}

.close-btn:hover {
    color: var(--text-primary);
    transform: rotate(90deg);
}

/* ========================================
   Form Styles
   ======================================== */

form {
    padding: var(--spacing-lg);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.form-field,
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-row .form-group {
    margin-bottom: 0;
}

.form-field label,
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.form-field input,
.form-group input,
.form-field select,
.form-group select,
.form-field textarea,
.form-group textarea {
    width: 100%;
    background: rgba(26, 34, 55, 0.7);
    border: 1px solid var(--bg-hover-strong);
    border-radius: var(--radius-md);
    padding: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    transition: all var(--transition-base);
    box-shadow: inset 0 2px 4px var(--bg-hover-strong);
}

.form-field input:focus,
.form-group input:focus,
.form-field select:focus,
.form-group select:focus,
.form-field textarea:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

.form-field input[type="checkbox"],
.form-group input[type="checkbox"] {
    width: auto;
    margin: 0;
    padding: 0;
    box-shadow: none;
    background: transparent;
    border: none;
    cursor: pointer;
    vertical-align: middle;
    accent-color: var(--primary-color);
}

.form-field input[readonly],
.form-group input[readonly] {
    background: var(--scrollbar-track);
    color: var(--text-muted);
    cursor: not-allowed;
}

.form-field textarea,
.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.attachment-area {
    margin-top: var(--spacing-sm);
}

.btn-attach-file {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 10px 16px;
    background: rgba(0, 212, 170, 0.1);
    border: 1px dashed var(--primary-color);
    border-radius: var(--radius-md);
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-attach-file:hover {
    background: rgba(0, 212, 170, 0.2);
    transform: translateY(-2px);
}

.attachments-preview {
    margin-top: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.attachment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.attachment-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.attachment-icon {
    color: var(--primary-color);
}

.attachment-name {
    font-size: 13px;
    color: var(--text-primary);
}

.attachment-remove {
    cursor: pointer;
    color: var(--error-color);
    transition: all var(--transition-base);
}

.attachment-remove:hover {
    transform: scale(1.2);
}

.modal-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

.btn {
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 15px rgba(0, 212, 170, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 170, 0.4);
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-hover-strong);
}

.btn .material-icons-round {
    font-size: 18px;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
    .chat-container {
        margin: 0;
        height: 100vh;
        border-radius: 0;
        border: none;
        overflow: hidden;
    }

    .chat-header-bar {
        padding: var(--spacing-md);
        flex-wrap: wrap;
        gap: 8px;
    }

    .header-info h1 {
        font-size: 16px;
    }


    .message-content {
        max-width: 95%;
    }

    .message.user .message-content {
        max-width: 95%;
    }

    .chat-success-title {
        font-size: 14px;
    }

    .chat-success-icon {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .chat-success-icon .material-icons-round {
        font-size: 18px;
    }

    .chat-success-header {
        gap: 10px;
    }

    .chat-success-card {
        padding: 12px;
    }

    .chat-success-details {
        padding: 8px 10px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
    }
}

/* ========================================
   Utility Classes
   ======================================== */

.hidden {
    display: none !important;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   Notification System
   ======================================== */
.notification-container {
    position: relative;
    display: flex;
    align-items: center;
    z-index: 101;
}

.notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--error-color);
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-secondary);
}

.notif-badge.hidden {
    display: none;
}

#btn-minimize {
    display: none !important;
}

.notif-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: -8px; 
    width: 280px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-base);
}

.notif-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notif-header {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--scrollbar-track);
}

.notif-header h3 {
    font-size: 14px;
    font-weight: 600;
}

.notif-list {
    max-height: 360px;
    overflow-y: auto;
}

.notif-item {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.notif-item:hover {
    background: var(--bg-hover);
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 212, 170, 0.1);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notif-icon .material-icons-round {
    font-size: 18px;
}

.notif-content {
    flex: 1;
}

.notif-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
    color: var(--text-primary);
}

.notif-message {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 6px;
    overflow-wrap: break-word;
    word-break: break-word;
}

.notif-time {
    font-size: 10px;
    color: var(--text-muted);
}

.notif-empty {
    padding: 30px 20px;
    text-align: center;
    color: var(--text-muted);
}

.notif-empty span {
    font-size: 40px;
    display: block;
    margin-bottom: 12px;
    opacity: 0.5;
}

.btn-icon-small {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon-small:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.checkbox-group label {
    font-size: 14px;
    font-weight: normal;
    margin-bottom: 0;
}

/* ========================================
   Google Style AI Avatar Design
   ======================================== */
.google-ai-avatar.bot-avatar,
.google-ai-avatar.chat-bot-avatar {
    width: 40px !important;
    height: 40px !important;
    background: linear-gradient(135deg, #4285F4, #9b72cb, #d96570, #f4b400) !important;
    background-size: 300% 300% !important;
    animation: googleAvatarGradient 8s ease infinite, googleAvatarPulse 3s ease-in-out infinite alternate !important;
    border-radius: 50% !important;
    /* Perfectly circular */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    box-shadow: 0 4px 15px rgba(66, 133, 244, 0.4) !important;
    position: relative !important;
    overflow: hidden !important;
    border: none !important;
}

@keyframes googleAvatarGradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes googleAvatarPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(66, 133, 244, 0.4);
    }

    100% {
        transform: scale(1.05);
        box-shadow: 0 6px 22px rgba(155, 114, 203, 0.6);
    }
}

.sparkle-container {
    position: relative;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.ai-spark {
    position: absolute;
    animation: spinSpark 10s linear infinite;
    transform-origin: center center;
}

.core-spark {
    width: 24px;
    height: 24px;
    z-index: 2;
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.8));
}

.mini-spark {
    width: 10px;
    height: 10px;
    top: -4px;
    right: -4px;
    z-index: 3;
    animation: spinSparkReverse 6s linear infinite;
    opacity: 0.9;
    filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.9));
}

@keyframes spinSpark {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes spinSparkReverse {
    from {
        transform: rotate(360deg);
    }

    to {
        transform: rotate(0deg);
    }
}

@keyframes pulseRecording {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
        background: rgba(239, 68, 68, 0.2);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
        background: rgba(239, 68, 68, 0.5);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
        background: rgba(239, 68, 68, 0.2);
    }
}

.icon-btn.recording {
    color: #ef4444 !important;
    animation: pulseRecording 1.5s infinite;
}
/* Policies View in Chat */
.view-container {
    padding: 16px;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
}

.view-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.view-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.back-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 50%;
    transition: background 0.2s;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.chat-policies-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.chat-policies-grid {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-policy-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.2s, background 0.2s;
}

.chat-policy-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
}

.chat-policy-icon {
    width: 44px;
    height: 44px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-policy-info {
    flex: 1;
}

.chat-policy-info strong {
    display: block;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.chat-policy-info p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 2px 0 0 0;
}

.chat-policy-view {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-policy-view:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-primary);
}

.loading-state, .empty-msg, .error-msg {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.rotate { animation: spin 2s linear infinite; }
@keyframes spin { 100% { transform: rotate(360deg); } }

