/* Global Variables */
:root {
    --bg-color: #000000;
    --bg-gradient: radial-gradient(circle at 50% 10%, #1a1a2e 0%, #000000 100%);
    --glass-bg: rgba(20, 20, 20, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-color: #f0f0f0;
    --accent-color: #3b82f6;
    /* Aywen-like blue */
    --accent-glow: rgba(59, 130, 246, 0.3);
    --accent-hover: #2563eb;
    --gold-color: #d4af37;
    /* For Producer/Admin */
    --danger-color: #ef4444;
    --sidebar-width: 220px;
    --modal-bg: rgba(20, 20, 20, 0.85);
}

@keyframes pulse-gold {
    0% {
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.4);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(212, 175, 55, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0);
    }
}

@keyframes pulse-blue {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(59, 130, 246, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    scrollbar-width: thin;
    scrollbar-color: rgba(59, 130, 246, 0.3) transparent;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

#chat-input::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

/* ==================== CHAT LAYOUT FIXES (RESPONSIVE) ==================== */

/* Ensure the main container holding the chat is full height */
.main-content {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    /* Prevent body scroll when chat is active */
    padding: 0 !important;
    /* Remove padding to let chat fill screen */
}

/* Chat Interface (The main wrapper) */
#chat-interface {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    position: relative;
    /* background: radial-gradient(circle at center, rgba(255, 255, 255, 0.03) 1px, transparent 1px); */
    /* background-size: 20px 20px; */
}

/* Header inside chat */
.section-header {
    flex-shrink: 0;
    /* Keep header size fixed */
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease-out;
    z-index: 10;
}

.login-logo {
    width: 120px;
    height: auto;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.4));
    animation: float 6s ease-in-out infinite;
}

/* Messages container */
#chat-messages {
    flex-grow: 1;
    /* Take all available space */
    overflow-y: auto;
    /* Scrollable */
    scroll-behavior: smooth;
    padding: 20px;
    padding-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 0 !important;
    /* remove old margin */
}

/* Input area - Refined */
.chat-input-area {
    flex-shrink: 0;
    /* Don't shrink */
    margin: 0 !important;
    /* Reset margin from previous style */
    padding: 15px !important;
    background: rgba(18, 18, 24, 0.95) !important;
    /* Solid background to cover messages */
    border-radius: 20px 20px 0 0 !important;
    /* Top rounded only for sticky bottom */
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-left: none;
    border-right: none;
    border-bottom: none;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.3) !important;
    backdrop-filter: none;
    /* override previous backdrop */
}

@media (max-width: 768px) {
    .main-content {
        height: 100dvh;
        /* Dynamic viewport height for modern browsers */
        padding-top: 0 !important;
        /* We handle header inside */
    }

    #chat-interface {
        height: 100%;
    }

    /* Adjust padding for mobile header */
    .section-header {
        padding-top: 60px;
        /* Space for mobile menu toggle */
    }

    .chat-input-area {
        padding: 10px !important;
        padding-bottom: max(10px, env(safe-area-inset-bottom)) !important;
        /* iOS Home Bar */
        margin: 0 !important;
        border-radius: 0 !important;
        /* Full width on mobile */
    }

    /* Fix suggestion card overlap */
    .chat-bubble {
        max-width: 85%;
    }

    /* Mobile Chat Messages Adjustment */
    #chat-messages {
        padding: 80px 15px 20px 15px !important;
        /* Top padding for header, small side padding */
        display: flex !important;
        flex-direction: column !important;
    }

    /* Force messages to bottom when few */
    #chat-messages> :first-child {
        margin-top: auto !important;
    }
}

body {
    background: var(--bg-gradient);
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
    font-size: 14px;
    position: relative;
}

/* Layout Grid */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: relative;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-right: 1px solid var(--glass-border);
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    transition: transform 0.3s ease;
    z-index: 100;
    left: 0;
    top: 0;
    overflow-y: auto;
    flex-shrink: 0;
}

.brand {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 30px;
    color: white;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    margin-bottom: 20px;
}

.sidebar-logo {
    max-width: 100%;
    max-height: 80px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.3));
}



.nav-links {
    list-style: none;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nav-btn {
    width: 100%;
    background: transparent;
    border: none;
    color: #888;
    padding: 10px 15px;
    text-align: left;
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    font-weight: 500;
    text-decoration: none !important;
}

.nav-btn i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.nav-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.nav-btn.active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0.05) 100%);
    color: white;
    border-left: 3px solid var(--accent-color);
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}

.user-info {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid var(--glass-border);
    font-size: 0.8rem;
    color: #666;
}

/* Main Content */
.main-content {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    padding: 30px 40px;
    width: calc(100% - var(--sidebar-width));
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Section Visibility */
.section-view {
    display: none;
}

.section-view.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

/* Center chat section vertically */
#chat.section-view.active {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 80px);
}

.content-card {
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    min-height: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.4s ease;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.content-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), 0 0 15px rgba(59, 130, 246, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

/* Headings */
h2 {
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.5px;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

h2 i {
    color: var(--accent-color);
    font-size: 1.2rem;
    filter: drop-shadow(0 0 5px rgba(59, 130, 246, 0.5));
}

/* Action Bar */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--glass-border);
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
}

/* Editors */
.editor {
    width: 100%;
    min-height: 50vh;
    max-height: 70vh;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: #ddd;
    padding: 20px;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    font-family: 'Consolas', 'Monaco', monospace;
    transition: box-shadow 0.2s;
    box-sizing: border-box;
}

.editor:focus {
    border-color: rgba(59, 130, 246, 0.6);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
    background: rgba(0, 0, 0, 0.5);
}

/* Buttons */
.btn {
    padding: 10px 18px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease-in-out;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5), 0 0 10px rgba(59, 130, 246, 0.2);
}

/* Calendar Styles */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background: transparent;
    padding: 0;
    border: none;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.calendar-day-name {
    text-align: center;
    font-weight: 600;
    margin-bottom: 5px;
    color: #666;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.calendar-day {
    background: rgba(255, 255, 255, 0.03);
    min-height: 100px;
    border-radius: 10px;
    padding: 10px;
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}

.calendar-day:not(.disabled):hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: #555;
    transform: translateY(-2px);
}

.calendar-day.today {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--accent-color);
}

.day-number {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: #888;
}

.calendar-day.today .day-number {
    color: var(--accent-color);
}

.event-marker {
    font-size: 0.8rem;
    background: rgba(59, 130, 246, 0.2);
    color: white;
    padding: 2px 5px;
    border-radius: 4px;
    margin-top: 5px;
    border-left: 3px solid var(--accent-color);
    word-wrap: break-word;
    line-height: 1.2;
}

/* Chat Header Actions & Call Button */
.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-call-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-color);
    border: 1px solid rgba(59, 130, 246, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.1rem;
}

.chat-call-btn:hover {
    background: var(--accent-color);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

/* Mobile adjustments for call button */
@media (max-width: 768px) {
    .chat-call-btn {
        width: 44px;
        /* Larger hit area */
        height: 44px;
        margin-right: 10px;
        /* Move away from edge */
        background: rgba(59, 130, 246, 0.2);
        /* More visible bg */
    }
}

/* ==================== WHATSAPP CHAT STYLES ==================== */

/* Chat Container with WhatsApp background */
.chat-container,
#chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px 60px;
    background-color: #0b141a;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    display: flex;
    flex-direction: column;
    gap: 4px;
    scroll-behavior: smooth;
    max-height: none;
    box-sizing: border-box;
    border-radius: 0;
    margin-bottom: 0;
}

/* WhatsApp Message Wrapper */
.chat-message-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-width: 65%;
    position: relative;
    animation: msgSlideIn 0.3s ease;
    margin: 2px 0;
}

@keyframes msgSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message-wrapper:hover .msg-actions {
    opacity: 1;
    transform: translateY(0);
}

/* WhatsApp Chat Bubbles */
.chat-bubble {
    padding: 6px 12px 8px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
    transition: all 0.15s ease;
    word-wrap: break-word;
}

/* Own messages - Green */
.chat-bubble.own {
    background: #005c4b;
    border-top-right-radius: 0;
    color: #e9edef;
}

/* Other messages - Dark gray */
.chat-bubble.other {
    background: #202c33;
    border-top-left-radius: 0;
    color: #e9edef;
}

/* Bubble tail for own messages */
.chat-bubble.own::before {
    content: '';
    position: absolute;
    top: 0;
    right: -8px;
    width: 0;
    height: 0;
    border-left: 8px solid #005c4b;
    border-top: 8px solid transparent;
}

/* Bubble tail for other messages */
.chat-bubble.other::before {
    content: '';
    position: absolute;
    top: 0;
    left: -8px;
    width: 0;
    height: 0;
    border-right: 8px solid #202c33;
    border-top: 8px solid transparent;
}

.chat-bubble-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 2px;
}

.chat-bubble-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #53bdeb;
}

.chat-bubble.own .chat-bubble-name {
    color: #7fdbb6;
}

.chat-bubble-time {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.6);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.chat-bubble-text {
    font-size: 0.9rem;
    line-height: 1.35;
}

/* Message footer with time and checkmarks */
.chat-bubble-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.chat-bubble-footer .time {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Read checkmarks */
.read-checks {
    font-size: 0.85rem;
    margin-left: 3px;
}

.read-checks.sent {
    color: rgba(255, 255, 255, 0.5);
}

.read-checks.delivered {
    color: rgba(255, 255, 255, 0.5);
}

.read-checks.read {
    color: #53bdeb;
}

/* ==================== WHATSAPP VOICE MESSAGE STYLES ==================== */

/* Voice message container - Compact & Clean */
.voice-message {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 260px;
    max-width: 320px;
    padding: 6px 4px;
    background: transparent;
    user-select: none;
}

/* Play/Pause button */
.voice-play-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #202c33;
    /* Darker background for button */
    border: none;
    color: #8696a0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.15s ease;
    flex-shrink: 0;
    margin-left: 4px;
}

.chat-bubble.own .voice-play-btn {
    background: #004d40;
    /* Slightly darker green */
    color: #bfa0a0;
    /* Just kidding, light gray */
    color: #e9edef;
}

.voice-play-btn:hover {
    filter: brightness(1.1);
}

/* Waveform Container */
.voice-content-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-width: 140px;
}

/* Waveform Bars */
.voice-waveform {
    height: 24px;
    display: flex;
    align-items: center;
    gap: 2px;
    opacity: 0.8;
}

.voice-waveform .bar {
    width: 3px;
    /* Thinner bars */
    background: #8696a0;
    border-radius: 3px;
    min-height: 3px;
    transition: all 0.1s ease;
}

.chat-bubble.own .voice-waveform .bar {
    background: #6ba8a0;
    /* Greenish gray for own */
}

/* Playing state colors */
.voice-waveform .bar.played {
    background: #53bdeb;
    /* Blue for others */
}

.chat-bubble.own .voice-waveform .bar.played {
    background: #dcf8c6;
    /* Light green/white for own */
}

/* Meta info row (Duration + Speed) */
.voice-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-right: 4px;
}

.voice-duration {
    font-size: 0.7rem;
    color: #8696a0;
    font-family: 'Inter', sans-serif;
    min-width: 35px;
}

.chat-bubble.own .voice-duration {
    color: rgba(255, 255, 255, 0.6);
}

/* Playback Speed Button (Pill shape) */
.voice-speed-btn {
    font-size: 0.75rem;
    font-weight: 500;
    background: rgba(134, 150, 160, 0.15);
    color: #8696a0;
    padding: 2px 8px;
    border-radius: 12px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    min-width: 28px;
    text-align: center;
}

.chat-bubble.own .voice-speed-btn {
    background: rgba(0, 0, 0, 0.2);
    color: #e9edef;
}

.voice-speed-btn:hover {
    background: rgba(134, 150, 160, 0.3);
}

.voice-speed-btn.active {
    background: #53bdeb;
    color: white !important;
}

.chat-bubble.own .voice-speed-btn.active {
    background: #fff;
    color: #005c4b !important;
}

/* User avatar box (Right side) */
.voice-avatar-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    height: 40px;
    margin-left: 8px;
}

.voice-mic-status {
    width: 10px;
    height: 10px;
    background: #00a884;
    /* Green dot for unplayed */
    border-radius: 50%;
    /* Only show if not played */
}

.voice-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    background: #ccc;
    display: none;
    /* Hidden by default layout, shown if needed */
}

/* Recording UI */
.voice-recording-ui {
    display: none;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    background: #1f2c33;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    animation: slideUp 0.2s ease;
}

.voice-recording-ui.active {
    display: flex;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.recording-cancel {
    color: #ef4444;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    border-radius: 20px;
    transition: background 0.2s;
}

.recording-cancel:hover {
    background: rgba(239, 68, 68, 0.1);
}

.recording-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-grow: 1;
}

.recording-dot {
    width: 10px;
    height: 10px;
    background: #ef4444;
    border-radius: 50%;
    animation: pulse 1s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.9);
    }
}

.recording-timer {
    font-size: 1rem;
    color: #fff;
    font-family: 'Monaco', 'Consolas', monospace;
}

.recording-waveform {
    flex-grow: 1;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    overflow: hidden;
}

.recording-waveform .wave-bar {
    width: 3px;
    background: #53bdeb;
    border-radius: 2px;
    animation: wave 0.5s ease-in-out infinite alternate;
}

@keyframes wave {
    0% {
        height: 5px;
    }

    100% {
        height: 25px;
    }
}

.recording-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00a884, #008069);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 168, 132, 0.3);
}

.recording-send:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(0, 168, 132, 0.4);
}

/* ==================== TYPING INDICATOR ==================== */

.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: #202c33;
    border-radius: 8px;
    border-top-left-radius: 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
    animation-delay: 0s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-6px);
    }
}

.chat-bubble-text {
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
}

/* Reply Preview Block */
.chat-reply-preview {
    background: rgba(0, 0, 0, 0.2);
    border-left: 3px solid var(--accent-color);
    padding: 6px 10px;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 0.8rem;
    opacity: 0.85;
}

.chat-reply-preview .reply-author {
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 2px;
}

.chat-reply-preview .reply-text {
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* Message Action Buttons */
.msg-actions {
    display: flex;
    gap: 5px;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.2s ease;
    justify-content: flex-end;
}

.msg-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #aaa;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    transition: all 0.2s ease;
}

.msg-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: scale(1.1);
}

.msg-action-btn.reply:hover {
    background: rgba(59, 130, 246, 0.3);
    color: #60a5fa;
}

.msg-action-btn.edit:hover {
    background: rgba(234, 179, 8, 0.3);
    color: #facc15;
}

.msg-action-btn.delete:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

/* Reply Bar (when replying to a message) */
.chat-reply-bar {
    display: none;
    background: rgba(59, 130, 246, 0.15);
    border-left: 3px solid var(--accent-color);
    padding: 10px 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    position: relative;
    animation: slideDown 0.2s ease;
}

.chat-reply-bar.active {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-reply-bar .reply-info {
    flex-grow: 1;
}

.chat-reply-bar .reply-info .reply-to {
    font-size: 0.75rem;
    color: var(--accent-color);
    font-weight: 600;
}

.chat-reply-bar .reply-info .reply-text {
    font-size: 0.85rem;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

.chat-reply-bar .close-reply {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 5px;
    font-size: 1rem;
}

.chat-reply-bar .close-reply:hover {
    color: white;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Old styles kept for backwards compatibility */
.chat-message {
    max-width: 75%;
    padding: 14px 18px;
    border-radius: 18px;
    position: relative;
    animation: fadeIn 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.chat-message.admin {
    align-self: flex-start;
    background: linear-gradient(135deg, #d4af37, #b8860b);
    /* Gold gradient */
    color: black;
    font-weight: 500;
    border-bottom-left-radius: 4px;
}

.chat-message.team {
    align-self: flex-end;
    background: rgba(40, 40, 50, 0.9);
    border: 1px solid var(--glass-border);
    color: #edf2f7;
    border-bottom-right-radius: 4px;
}

.chat-user {
    font-size: 0.75rem;
    font-weight: 700;
    opacity: 0.9;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
}

.chat-text {
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-time {
    font-size: 0.65rem;
    opacity: 0.6;
    text-align: right;
    margin-top: 6px;
}

.chat-input-area {
    display: flex;
    gap: 12px;
    padding-top: 15px;
    border-top: 1px solid var(--glass-border);
}

.chat-input-area input {
    flex-grow: 1;
    padding: 14px 20px;
    border-radius: 25px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s;
}

.chat-input-area input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
    background: rgba(0, 0, 0, 0.5);
}

.chat-input-area button {
    border-radius: 50%;
    width: 48px;
    height: 48px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.2rem;
}

/* ==================== GLOBAL MODAL STYLES ==================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.85);
    /* Darker backdrop */
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s;
}

.modal-content {
    background: #1a1a20;
    /* Solid dark color */
    margin: 10% auto;
    padding: 30px;
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    position: relative;
    text-align: center;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

.close-modal:hover {
    color: white;
}

#modal-date {
    color: var(--accent-color);
    margin-bottom: 20px;
    font-size: 1.5rem;
}

#modal-text {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
    white-space: pre-wrap;
    color: #ddd;
}

/* ==================== NEW SETTINGS STYLES ==================== */
.settings-header {
    margin-bottom: 25px;
}

.settings-header h2 {
    font-size: 1.6rem;
    margin-bottom: 5px;
}

.settings-subtitle {
    color: #888;
    font-size: 0.95rem;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    padding-bottom: 30px;
}

.settings-card {
    background: linear-gradient(145deg, rgba(30, 30, 35, 0.9), rgba(20, 20, 25, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.settings-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.settings-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.settings-card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    margin: 0;
}

.settings-card-header p {
    font-size: 0.85rem;
    color: #888;
    margin: 3px 0 0 0;
}

.settings-icon-wrapper {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.settings-icon-wrapper.blue {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.settings-icon-wrapper.green {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.settings-icon-wrapper.purple {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
}

.settings-icon-wrapper.red {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.settings-card-body {
    padding: 20px;
}

/* Profile Card */
.settings-profile-card {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
    border-color: rgba(59, 130, 246, 0.2);
}

.profile-content {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 25px;
}

.profile-avatar-large {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d4af37, #f5d77a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #1a1a2e;
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.3);
}

.profile-info h3.profile-name-large {
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
    margin: 0 0 5px 0;
}

.profile-badge {
    display: inline-block;
    background: linear-gradient(135deg, #d4af37, #b8860b);
    color: black;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Form Styles */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: #aaa;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: white;
    font-size: 0.95rem;
    transition: all 0.3s;
    box-sizing: border-box;
}

.form-input:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    background: rgba(0, 0, 0, 0.5);
}

/* Settings Buttons */
.settings-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    width: 100%;
}

.settings-btn.primary {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.settings-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.settings-btn.success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.settings-btn.success:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.settings-btn.outline {
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    color: #aaa;
}

.settings-btn.outline:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: rgba(59, 130, 246, 0.1);
}

.settings-btn.danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.settings-btn.danger:hover {
    background: rgba(239, 68, 68, 0.25);
    background: rgba(239, 68, 68, 0.2);
    transform: translateY(-2px);
}

.edit-member-btn {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 5px;
}

.edit-member-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: translateY(-2px);
}

/* Team List */
.team-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.team-member {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.team-member:hover {
    background: rgba(255, 255, 255, 0.06);
}

.member-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.member-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.member-name {
    font-weight: 500;
    color: #eee;
}

.delete-member-btn {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.delete-member-btn:hover {
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
}

.empty-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 30px;
    color: #666;
}

.empty-team i {
    font-size: 2rem;
    opacity: 0.5;
}

/* Add Member Form */
.add-member-section {
    margin-top: 10px;
}

.add-member-form {
    display: none;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    animation: fadeIn 0.3s ease;
}

.add-member-form.show {
    display: flex;
}

.color-picker-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.color-picker-row label {
    font-size: 0.85rem;
    color: #aaa;
}

.color-picker-row input[type="color"] {
    width: 50px;
    height: 35px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

/* Danger Zone */
.danger-card {
    border-color: rgba(239, 68, 68, 0.2);
}

.danger-card:hover {
    border-color: rgba(239, 68, 68, 0.4);
}

.danger-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .profile-content {
        flex-direction: column;
        text-align: center;
    }
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d4af37, #f3e5ab);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: rgba(0, 0, 0, 0.8);
    margin-bottom: 20px;
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.3);
    border: 3px solid rgba(255, 255, 255, 0.1);
}

.profile-name {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(to right, #fff, #bbb);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
}

.profile-role {
    color: #d4af37;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
    margin-bottom: 10px;
}

.settings-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.settings-input-group {
    width: 100%;
    text-align: left;
    box-sizing: border-box;
}

.settings-input-group label {
    display: block;
    margin-bottom: 10px;
    color: #aaa;
    font-size: 0.9rem;
    font-weight: 500;
    margin-left: 5px;
}

.settings-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px 18px;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.settings-input:focus {
    background: rgba(0, 0, 0, 0.6);
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.btn-update {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.btn-update:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5);
}

/* ==================== TOAST NOTIFICATIONS ==================== */
#toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.toast {
    min-width: 300px;
    background: rgba(25, 25, 30, 0.95);
    backdrop-filter: blur(12px);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    border-left: 6px solid;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1rem;
    animation: slideIn 0.4s ease forwards, fadeOut 0.5s ease 3s forwards;
}

.toast.success {
    border-color: #10b981;
}

.toast.error {
    border-color: #ef4444;
}

.toast i {
    font-size: 1.4rem;
}

.toast.success i {
    color: #10b981;
}

.toast.error i {
    color: #ef4444;
}

/* Mobile Toggle */
.menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 200;
    background: rgba(10, 10, 10, 0.8);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(10px);
        visibility: hidden;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 100%;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 100%;
        background: rgba(0, 0, 0, 0.98);
        height: 100vh;
        overflow-y: auto;
        padding-bottom: 100px;
        position: fixed;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 15px;
        padding-top: 60px;
        width: 100%;
    }

    .menu-toggle {
        display: block;
    }

    .calendar-grid {
        gap: 3px;
    }

    .calendar-day {
        min-height: 50px;
        padding: 5px;
    }

    .event-marker {
        display: none;
        /* Hide text markers on mobile */
    }

    .calendar-day.today::after {
        content: '';
        display: block;
        width: 6px;
        height: 6px;
        background: var(--accent-color);
        border-radius: 50%;
        margin: 4px auto 0;
    }

    .chat-message {
        max-width: 85%;
        padding: 12px;
    }

    .settings-container {
        grid-template-columns: 1fr;
    }
}

/* ==================== UNIFIED SUGGESTION DIFF ==================== */
.suggestion-unified {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 15px;
    font-family: 'Consolas', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #ccc;
    white-space: pre-wrap;
    max-height: 400px;
    overflow-y: auto;
}

/* Highlight Classes */
.diff-added {
    color: #ef4444;
    /* Red for added/removed phrases per user request */
    background: rgba(239, 68, 68, 0.1);
    border-bottom: 2px solid #ef4444;
    cursor: pointer;
    font-weight: bold;
}

.diff-modified {
    color: #3b82f6;
    /* Blue for modified words */
    background: rgba(59, 130, 246, 0.1);
    border-bottom: 2px solid #3b82f6;
    cursor: pointer;
    font-weight: bold;
}

.diff-removed {
    text-decoration: line-through;
    color: #ef4444;
    /* Red for removed */
    background: rgba(239, 68, 68, 0.1);
    opacity: 0.7;
    margin-right: 2px;
    cursor: pointer;
}

/* Tooltip/Hover Effect (optional, but using click for modal) */
.diff-added:hover,
.diff-modified:hover,
.diff-removed:hover {
    filter: brightness(1.2);
}

/* Diff Modal Styles */
.diff-modal-content {
    max-width: 800px;
    width: 90%;
}

.diff-comparison {
    display: flex;
    gap: 20px;
    align-items: stretch;
}

.diff-comp-block {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.diff-comp-block h4 {
    margin-bottom: 10px;
    color: #888;
    text-align: left;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.diff-arrow {
    display: flex;
    align-items: center;
    color: #666;
    font-size: 1.5rem;
}

.diff-text-box {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
    padding: 15px;
    border-radius: 8px;
    height: 100%;
    white-space: pre-wrap;
    font-family: 'Consolas', monospace;
    font-size: 0.9rem;
    color: #eee;
    text-align: left;
}

.diff-comp-block.old .diff-text-box {
    border-left: 3px solid #ef4444;
}

.diff-comp-block.new .diff-text-box {
    border-left: 3px solid #3b82f6;
}

@media (max-width: 768px) {
    .diff-comparison {
        flex-direction: column;
    }

    .diff-arrow {
        transform: rotate(90deg);
        justify-content: center;
        padding: 10px 0;
    }
}

/* ==================== CONTEXT MENU (Chat) ==================== */
.context-menu {
    position: absolute;
    background: rgba(10, 10, 15, 0.95);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 12px;
    padding: 8px;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: none;
    flex-direction: column;
    min-width: 150px;
    animation: fadeIn 0.2s ease-out;
}

.context-menu-item {
    padding: 10px 15px;
    color: white;
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
}

.context-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.context-menu-item.danger {
    color: #ff6b6b;
}

.context-menu-item.danger:hover {
    background: rgba(255, 107, 107, 0.15);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ==================== SUGGESTIONS SYSTEM ==================== */
.suggestions-review-area {
    margin-bottom: 2rem;
}

.suggestion-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    animation: fadeIn 0.3s ease;
    box-sizing: border-box;
    overflow: visible;
    transition: all 0.3s ease;
}

.suggestion-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.suggestion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 15px;
}

.suggestion-diff {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 15px;
}

@media (max-width: 768px) {
    .suggestion-diff {
        grid-template-columns: 1fr;
    }
}

.diff-block {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 15px;
    overflow: hidden;
    position: relative;
}

.diff-block h4 {
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    opacity: 0.7;
    color: #aaa;
}

.diff-block pre {
    font-family: 'Consolas', monospace;
    font-size: 0.95em;
    white-space: pre-wrap;
    color: #eee;
    margin: 0;
    line-height: 1.5;
}

.diff-block.old {
    border-top: 3px solid #666;
}

.diff-block.new {
    border-top: 3px solid var(--accent-color);
}

/* Status Badges */
.badge {
    font-size: 0.75em;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.accepted {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge.rejected {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge.partial {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge.pending {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Edit Mode for Partial */
.edit-area {
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 10px;
    border-radius: 8px;
    min-height: 100px;
    font-family: inherit;
    resize: vertical;
    display: none;
}

.suggestion-card.edit-mode .diff-block.new pre {
    display: none;
}

.suggestion-card.edit-mode .edit-area {
    display: block;
}

/* ==================== NEW CHAT LAYOUT (WhatsApp Style) ==================== */
.chat-sidebar {
    width: 300px;
    background: rgba(0, 0, 0, 0.2);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.1);
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #eee;
}

.contact-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 5px;
    position: relative;
}

.contact-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.contact-item.active {
    background: rgba(59, 130, 246, 0.15);
    border-left: 3px solid var(--accent-color);
}

.contact-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 1rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.contact-info {
    flex-grow: 1;
    overflow: hidden;
}

.contact-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #eee;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-status {
    font-size: 0.75rem;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.unread-badge {
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
    display: none;
    animation: pulse-badge 2s infinite;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5);
}

.unread-badge.visible {
    display: inline-block;
}

@keyframes pulse-badge {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* Chat Main adjustments */
.chat-main {
    background-image: radial-gradient(circle at center, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
}

.chat-container {
    background: transparent;
    /* Remove old bg */
    border-radius: 0;
    margin-bottom: 0;
}

/* Mobile Responsive Chat */
@media (max-width: 768px) {
    .chat-sidebar {
        width: 100%;
        position: absolute;
        z-index: 10;
        height: 100%;
        background: #1a1a2e;
        transform: translateX(0);
        /* Shown by default on mobile */
        transition: transform 0.3s ease;
    }

    .chat-sidebar.closed {
        transform: translateX(-100%);
    }

    /* Legacy support: open class still works */
    .chat-sidebar.open {
        transform: translateX(0);
    }

    .mobile-chat-toggle {
        display: flex !important;
        background: rgba(59, 130, 246, 0.2);
        border: 1px solid rgba(59, 130, 246, 0.4);
        color: #60a5fa;
        font-size: 1.2rem;
        cursor: pointer;
        animation: pulseToggle 2s infinite;
    }
}

@keyframes pulseToggle {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.3);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(59, 130, 246, 0);
    }
}

/* Sidebar toggle button - visible on all screens */
.mobile-chat-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.mobile-chat-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    transform: scale(1.05);
}

.sidebar-section-header {
    padding: 15px 15px 5px 15px;
    font-size: 0.7rem;
    color: var(--accent-color);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    opacity: 0.8;
}

/* Edit Controls */
.edit-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: white;
    padding: 4px 8px;
    font-size: 0.9em;
}

.edit-controls {
    display: flex;
    gap: 5px;
    margin-top: 5px;
    justify-content: flex-end;
}

.btn-xs {
    padding: 2px 8px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 0.8em;
}

.btn-xs.confirm {
    background: #10b981;
    color: white;
}

.btn-xs.cancel {
    background: #ef4444;
    color: white;
}

/* ==================== NEW AESTHETIC IMPROVEMENTS ==================== */

/* Typing Indicator */
.typing-indicator {
    display: none;
    padding: 10px 15px;
    color: #888;
    font-size: 0.85rem;
    font-style: italic;
    animation: fadeIn 0.3s ease;
}

.typing-indicator.visible {
    display: flex;
    align-items: center;
    gap: 8px;
}

.typing-dots {
    display: flex;
    gap: 3px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: #888;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) {
    animation-delay: 0s;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {

    0%,
    80%,
    100% {
        transform: translateY(0);
        opacity: 0.5;
    }

    40% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

/* Main Content - Fixed Viewport for App-like feel */
.main-content {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    padding: 0 !important;
    position: relative;
    background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.05), transparent 40%),
        radial-gradient(circle at bottom left, rgba(16, 185, 129, 0.05), transparent 40%);
}

/* Scrollable Sections (Script, Info, Settings) */
.section-view {
    display: none;
    height: 100%;
    overflow-y: auto;
    /* Enable vertical scrolling */
    overflow-x: hidden;
    padding: 30px 40px;
    /* Restore padding inside the scrollable area */
    box-sizing: border-box;
    scroll-behavior: smooth;
}

/* Custom Scrollbar for Sections */
.section-view::-webkit-scrollbar {
    width: 6px;
}

.section-view::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.section-view::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.section-view::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.section-view.active {
    display: block;
    animation: fadeIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Chat Section Specifics */
#chat.section-view {
    padding: 0;
    /* Chat handles its own padding */
    overflow: hidden;
    /* Chat has internal scrolling */
}

/* Global Content Card Refinement */
.content-card {
    background: rgba(20, 20, 25, 0.6);
    /* Slightly darker/more unified */
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    /* More subtle border */
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    margin-bottom: 20px;
    /* Spacing between cards */
}

/* Modern Input Fields */
.form-input,
.editor {
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 14px 16px;
    font-size: 0.95rem;
}

.form-input:focus,
.editor:focus {
    border-color: var(--accent-color) !important;
    background: rgba(0, 0, 0, 0.5) !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15) !important;
    transform: translateY(-1px);
}

/* Settings Cards Improvement */
.settings-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.settings-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
}

.settings-card-header {
    background: rgba(255, 255, 255, 0.02);
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Mobile Adjustments for Scrolling */
@media (max-width: 768px) {
    .section-view {
        padding: 80px 15px 100px 15px;
        /* Top padding for menu, bottom for safe area */
    }

    #chat.section-view {
        padding: 0;
    }
}

/* Message Reactions */
.msg-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.reaction-btn {
    padding: 3px 8px;
    border-radius: 15px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #aaa;
    cursor: pointer;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 3px;
    transition: all 0.2s ease;
}

.reaction-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.reaction-btn.active {
    background: rgba(59, 130, 246, 0.3);
    color: #60a5fa;
}

.reaction-emoji {
    font-size: 0.9rem;
}

.reaction-count {
    font-size: 0.7rem;
    opacity: 0.8;
}

/* Add Reaction Button */
.add-reaction-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    background: transparent;
    color: #666;
    cursor: pointer;
    font-size: 0.7rem;
    transition: all 0.2s;
}

.add-reaction-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: scale(1.1);
}

/* Emoji Picker Popup */
.emoji-picker {
    position: absolute;
    background: rgba(30, 30, 35, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px;
    display: none;
    gap: 5px;
    flex-wrap: wrap;
    width: 180px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 100;
    animation: popIn 0.2s ease;
}

.emoji-picker.visible {
    display: flex;
}

.emoji-option {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s;
}

.emoji-option:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.2);
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Premium Hover Effects for Cards */
.content-card {
    position: relative;
    overflow: hidden;
}

.content-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.03), transparent);
    transition: 0.5s;
    pointer-events: none;
}

.content-card:hover::before {
    left: 100%;
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 500;
}

.fab:hover {
    transform: translateY(-3px) rotate(90deg);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.6);
}

/* Glassmorphism Effects */
.glass-panel {
    background: rgba(20, 20, 25, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Animated Gradient Background */
.animated-gradient {
    background: linear-gradient(-45deg, #0f172a, #1e1b4b, #0f172a, #172554);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Improved Button Hover */
.btn:not(:disabled) {
    position: relative;
    overflow: hidden;
}

.btn:not(:disabled)::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: width 0.4s, height 0.4s, top 0.4s, left 0.4s;
    transform: translate(-50%, -50%);
}

.btn:not(:disabled):hover::after {
    width: 300px;
    height: 300px;
}

/* Online Status Indicator */
.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    position: absolute;
    bottom: 2px;
    right: 2px;
    border: 2px solid #1a1a2e;
}

.status-indicator.online {
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

.status-indicator.offline {
    background: #6b7280;
}

.contact-avatar {
    position: relative;
}

/* Message Timestamp Animation */
.chat-bubble-time {
    transition: opacity 0.2s;
}

.chat-message-wrapper:hover .chat-bubble-time {
    opacity: 1;
}

/* Scroll Progress Indicator */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-color), #8b5cf6);
    width: 0%;
    z-index: 9999;
    transition: width 0.1s;
}

/* Empty State Illustrations */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 30px;
    text-align: center;
    color: #666;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.empty-state-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #888;
    margin-bottom: 10px;
}

.empty-state-desc {
    font-size: 0.9rem;
    max-width: 300px;
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
}

.skeleton-text:last-child {
    width: 60%;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Confetti Animation for Success */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--accent-color);
    animation: confettiFall 3s forwards;
    pointer-events: none;
    z-index: 10000;
}

@keyframes confettiFall {
    0% {
        opacity: 1;
        transform: translateY(0) rotate(0deg);
    }

    100% {
        opacity: 0;
        transform: translateY(100vh) rotate(720deg);
    }
}

/* Notification Dot */
.notification-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: var(--danger-color);
    border-radius: 50%;
    animation: pulse-badge 2s infinite;
}

/* Smooth Page Transitions */
.section-view {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.section-view.entering {
    opacity: 0;
    transform: translateY(20px);
}

.section-view.active {
    opacity: 1;
    transform: translateY(0);
}

/* Tooltip Style */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 100;
}

[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Read Receipts */
.read-receipt {
    margin-left: 5px;
    font-size: 0.7em;
    color: #4fc3f7;
    /* WhatsApp Blue */
}


.chat-bubble.other .read-receipt {
    display: none;
    /* Only show for my messages */
}

/* ==================== WHATSAPP STYLE CHAT INPUT ==================== */

.chat-input-area.whatsapp-style {
    display: flex !important;
    align-items: center;
    background: #1f2c33;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 12px;
    gap: 8px;
    margin: 0;
    border-radius: 0;
}

/* Icon Buttons (Plus, Emoji, Mic) */
.chat-icon-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.chat-icon-btn:hover {
    color: var(--accent-color);
    background: rgba(255, 255, 255, 0.05);
}

.chat-icon-btn:active {
    transform: scale(0.95);
}

/* Plus Button */
.chat-icon-btn.plus-btn {
    color: rgba(255, 255, 255, 0.5);
}

.chat-icon-btn.plus-btn:hover {
    color: var(--accent-color);
}

/* Emoji Button */
.chat-icon-btn.emoji-btn {
    color: rgba(255, 255, 255, 0.5);
}

.chat-icon-btn.emoji-btn:hover {
    color: #ffc107;
}

/* Microphone Button */
.chat-icon-btn.mic-btn {
    color: rgba(255, 255, 255, 0.5);
}

.chat-icon-btn.mic-btn:hover {
    color: var(--accent-color);
}

/* Text Input - WhatsApp Style */
#chat-input {
    flex-grow: 1;
    background: #2a3942 !important;
    border: none !important;
    border-radius: 20px;
    color: #fff;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.95rem;
    padding: 10px 16px;
    min-height: 40px;
    max-height: 120px;
    resize: none;
    outline: none !important;
    box-shadow: none !important;
    transition: background 0.2s ease;
}

#chat-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

#chat-input:focus {
    background: #2f3f48 !important;
}

/* Send Button */
.chat-send-btn {
    background: var(--accent-color);
    background: linear-gradient(135deg, var(--accent-color), #2563eb);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    flex-shrink: 0;
}

.chat-send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5);
}

.chat-send-btn:active {
    transform: scale(0.95);
}

/* Hidden class for button toggle */
.chat-send-btn.hidden,
.chat-icon-btn.hidden {
    display: none !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .chat-input-area.whatsapp-style {
        padding: 6px 8px;
        gap: 4px;
    }

    .chat-icon-btn {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }

    #chat-input {
        padding: 8px 12px;
        min-height: 36px;
        font-size: 0.9rem;
    }

    .chat-send-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
}

/* Emoji Picker positioning */
.chat-input-area.whatsapp-style .emoji-picker {
    position: absolute;
    bottom: 60px;
    left: 50px;
}

/* ==================== MODAL & UTILITY STYLES ==================== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s;
}

.modal-content {
    background: var(--modal-bg, rgba(20, 20, 20, 0.85));
    margin: 10% auto;
    padding: 30px;
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    color: var(--text-color);
    position: relative;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--accent-color);
}

.badge-notification {
    background: var(--accent-color);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.7em;
    margin-left: 8px;
    animation: pulse-blue 2s infinite;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    opacity: 0.6;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.empty-state i {
    font-size: 2.5em;
    color: var(--accent-color);
    opacity: 0.5;
}

.form-input {
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: white;
    margin-bottom: 15px;
    outline: none;
    transition: all 0.3s ease;
}

.form-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    background: rgba(0, 0, 0, 0.5);
}

/* ==================== VOICE CALL SYSTEM ==================== */

/* Call Button in Chat Header */
.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-call-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chat-call-btn:hover {
    background: rgba(34, 197, 94, 0.25);
    border-color: rgba(34, 197, 94, 0.5);
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
}

.chat-call-btn:active {
    transform: scale(0.95);
}

/* Call Overlay - Full Screen */
.call-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.call-overlay.active {
    display: flex;
    opacity: 1;
    animation: callFadeIn 0.4s ease forwards;
}

.call-overlay-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg,
            rgba(10, 10, 20, 0.97) 0%,
            rgba(15, 25, 40, 0.98) 50%,
            rgba(5, 10, 15, 0.99) 100%);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
}

.call-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 40px;
    text-align: center;
    animation: callSlideUp 0.5s ease forwards;
}

/* Call Status Text */
.call-status-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 500;
}

/* Call Avatar */
.call-avatar-wrapper {
    position: relative;
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

.call-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.8rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 40px rgba(59, 130, 246, 0.3);
    z-index: 2;
    position: relative;
}

/* Ring Animation */
.call-ring-animation {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    border-radius: 50%;
    z-index: 1;
}

.call-ring-animation::before,
.call-ring-animation::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 2px solid rgba(34, 197, 94, 0.4);
    animation: callRingPulse 2s ease-out infinite;
}

.call-ring-animation::before {
    width: 130px;
    height: 130px;
    animation-delay: 0s;
}

.call-ring-animation::after {
    width: 160px;
    height: 160px;
    animation-delay: 0.5s;
}

/* Call Name */
.call-name {
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    margin-top: 10px;
}

.call-subtitle {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: -10px;
}

/* Call Timer */
.call-timer {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    letter-spacing: 2px;
    font-variant-numeric: tabular-nums;
    margin-top: 5px;
}

/* Call Action Buttons */
.call-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 80px;
    margin-top: 50px;
}

.call-action-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.call-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: none;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.call-btn::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s;
}

.call-btn:hover::before {
    opacity: 1;
}

.call-btn:active {
    transform: scale(0.9);
}

/* Decline Button */
.call-btn.decline {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 4px 25px rgba(239, 68, 68, 0.4);
    animation: declinePulse 2s ease-in-out infinite;
}

.call-btn.decline:hover {
    box-shadow: 0 6px 35px rgba(239, 68, 68, 0.6);
    transform: scale(1.1);
}

.call-btn.decline::before {
    background: linear-gradient(135deg, #f87171, #ef4444);
}

/* Accept Button */
.call-btn.accept {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    box-shadow: 0 4px 25px rgba(34, 197, 94, 0.4);
    animation: acceptPulse 1.5s ease-in-out infinite;
}

.call-btn.accept:hover {
    box-shadow: 0 6px 35px rgba(34, 197, 94, 0.6);
    transform: scale(1.1);
}

.call-btn.accept::before {
    background: linear-gradient(135deg, #4ade80, #22c55e);
}

/* Accept button icon rotation */
.call-btn.accept i {
    animation: phoneShake 1s ease-in-out infinite;
}

.call-btn-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
}

/* ==================== CALL ANIMATIONS ==================== */

@keyframes callFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes callSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes callRingPulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.6;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

@keyframes acceptPulse {

    0%,
    100% {
        box-shadow: 0 4px 25px rgba(34, 197, 94, 0.4);
    }

    50% {
        box-shadow: 0 4px 40px rgba(34, 197, 94, 0.7);
    }
}

@keyframes declinePulse {

    0%,
    100% {
        box-shadow: 0 4px 25px rgba(239, 68, 68, 0.3);
    }

    50% {
        box-shadow: 0 4px 35px rgba(239, 68, 68, 0.5);
    }
}

@keyframes phoneShake {

    0%,
    100% {
        transform: rotate(0deg);
    }

    10% {
        transform: rotate(15deg);
    }

    20% {
        transform: rotate(-10deg);
    }

    30% {
        transform: rotate(12deg);
    }

    40% {
        transform: rotate(-8deg);
    }

    50% {
        transform: rotate(0deg);
    }
}

/* Mobile Responsive - Voice Call */
@media (max-width: 768px) {
    .call-actions {
        gap: 50px;
        margin-top: 40px;
    }

    .call-btn {
        width: 60px;
        height: 60px;
        font-size: 1.3rem;
    }

    .call-avatar {
        width: 100px;
        height: 100px;
        font-size: 2.2rem;
    }

    .call-ring-animation::before {
        width: 110px;
        height: 110px;
    }

    .call-ring-animation::after {
        width: 140px;
        height: 140px;
    }

    .call-name {
        font-size: 1.5rem;
    }

    .call-content {
        padding: 20px;
    }
}

/* ==================== PWA INSTALL MODAL ==================== */
.pwa-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.pwa-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.pwa-modal-content {
    background: linear-gradient(160deg, #1e293b, #0f172a);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 40px 30px;
    width: 85%;
    max-width: 380px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    transform: scale(0.9) translateY(20px);
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.pwa-modal-overlay.active .pwa-modal-content {
    transform: scale(1) translateY(0);
}

.pwa-icon-wrapper {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.4);
    margin-bottom: 5px;
}

.pwa-icon-wrapper img {
    width: 100%;
    height: 100%;
    border-radius: 20px;
    object-fit: cover;
}

.pwa-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.pwa-desc {
    font-size: 0.95rem;
    color: #94a3b8;
    line-height: 1.5;
    margin-bottom: 10px;
}

.pwa-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.pwa-btn-install {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.pwa-btn-install:active {
    transform: scale(0.98);
}

.pwa-btn-cancel {
    background: transparent;
    color: #64748b;
    border: none;
    padding: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.2s;
}

.pwa-btn-cancel:hover {
    color: #94a3b8;
}

/* ==================== MOBILE CHAT SIDEBAR ==================== */
/* Sidebar Header: Hidden on Desktop, Visible on Mobile */
.sidebar-header {
    display: none;
}

.mobile-chat-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    margin-right: 15px;
    /* Spacing from title */
}

.mobile-chat-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

@media (max-width: 768px) {

    /* Show Sidebar Header on Mobile */
    .sidebar-header {
        display: flex;
        /* or block */
        padding: 20px;
        align-items: center;
        justify-content: center;
        /* Center the text */
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .sidebar-header h3 {
        margin: 0;
        font-size: 1.2rem;
        color: white;
    }

    .mobile-chat-toggle {
        display: flex;
        z-index: 1002;
        /* Above everything in header */
    }

    /* Make sidebar absolute on mobile */
    .chat-wrapper {
        position: relative;
    }

    .chat-sidebar {
        position: absolute;
        top: 0;
        left: 0;
        width: 100% !important;
        /* Full width */
        height: 100% !important;
        z-index: 1000;
        /* Cover main chat */
        background: #1a1a2e;
        /* Ensure opacity */
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        transform: translateX(0);
        /* Default open (Contacts view) */
    }

    .chat-sidebar.closed {
        transform: translateX(-100%);
        /* Hidden (Chat view) */
    }

    /* Ensure main chat is always behind */
    .chat-main {
        width: 100% !important;
        flex: 1;
    }
}