@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&family=Outfit:wght@400;700&display=swap');

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-dark: #0f172a;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text: #f8fafc;
    --text-muted: #94a3b8;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

.noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.05;
    pointer-events: none;
    background: url('data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMjAwIDIwMCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJz48ZmlsdGVyIGlkPSduJz48ZmVUdXJidWxlbmNlIHR5cGU9J2ZyYWN0YWxOb2lzZScgYmFzZUZyZXF1ZW5jeT0nMC42NScgbnVtT2N0YXZlcz0nMyIgc3RpdGNoVGlsZXM9J3N0aXRjaCcvPjwvZmlsdGVyPjxyZWN0IHdpZHRoPScxMDAlJyBoZWlnaHQ9JzEwMCUnIGZpbHRlcj0ndXJsKCNuKScvPjwvc3ZnPg==');
}

.gradient-bg {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 100vh;
    z-index: -2;
    background: radial-gradient(circle at 0% 0%, #4338ca 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, #6366f1 0%, transparent 50%);
    opacity: 0.2;
}

.app-container {
    width: 90%;
    max-width: 1000px;
    background: var(--glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

header {
    text-align: center;
    margin-bottom: 40px;
}

h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    margin-bottom: 8px;
    background: linear-gradient(to right, #6366f1, #a855f7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

p.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.playbooks-link {
    display: inline-block;
    margin-top: 10px;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 5px 14px;
    border: 1px solid var(--primary);
    border-radius: 20px;
    transition: background 0.2s, color 0.2s;
}

.playbooks-link:hover {
    background: var(--primary);
    color: #fff;
}

.tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
    justify-content: center;
}

.tab-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 10px 24px;
    border-radius: 99px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.tab-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.tab-content {
    display: none;
    min-height: 300px;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* Voice Interface */
.voice-interface {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.mic-container {
    position: relative;
    width: 120px;
    height: 120px;
}

.mic-btn {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--primary);
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.4);
}

.mic-btn:hover {
    transform: scale(1.05);
    background: var(--primary-hover);
}

.mic-btn.recording {
    background: #ef4444;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }

    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 20px rgba(239, 68, 68, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.mic-btn svg {
    width: 48px;
    height: 48px;
    fill: white;
}

.status-indicator {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.transcription-area {
    width: 100%;
    padding: 24px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    min-height: 100px;
    color: var(--text);
    line-height: 1.6;
    font-size: 1.1rem;
    border: 1px solid var(--glass-border);
}

/* Knowledge Interface */
.knowledge-interface {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.upload-zone {
    border: 2px dashed var(--glass-border);
    border-radius: 16px;
    padding: 60px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-zone:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.upload-zone svg {
    width: 48px;
    height: 48px;
    fill: var(--text-muted);
    margin-bottom: 16px;
}

.file-input {
    display: none;
}

.upload-status {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Debug Components */
.volume-meter {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 3px solid var(--primary);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.1s ease-out, opacity 0.2s ease;
}

.debug-bar {
    font-family: monospace;
    font-size: 0.75rem;
    padding: 4px 12px;
    margin-top: 10px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    color: var(--text-muted);
    border: 1px solid var(--glass-border);
}

.debug-bar.active {
    color: #ffd700;
    border-color: #ffd700;
}

/* Speaking Indicator */
.speaking-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    height: 30px;
    margin-bottom: 20px;
}

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

.speaking-indicator span {
    margin-left: 10px;
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 600;
}

.speaking-indicator .bar {
    width: 6px;
    height: 80%;
    background: var(--primary);
    border-radius: 3px;
    animation: wave 1s infinite ease-in-out;
}

.speaking-indicator .bar:nth-child(1) {
    animation-delay: 0.0s;
}

.speaking-indicator .bar:nth-child(2) {
    animation-delay: 0.1s;
}

.speaking-indicator .bar:nth-child(3) {
    animation-delay: 0.2s;
}

.speaking-indicator .bar:nth-child(4) {
    animation-delay: 0.3s;
}

@keyframes wave {

    0%,
    100% {
        height: 30%;
    }

    50% {
        height: 100%;
    }
}

/* Document List */
.file-list-container {
    padding: 0 20px;
}

.file-list-container h3 {
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: var(--text);
}

.file-list {
    list-style: none;
}

.file-list li {
    padding: 12px 16px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
}

.file-list li:hover {
    background: rgba(255, 255, 255, 0.1);
}

.file-list li::before {
    content: "📄";
    font-size: 1.1rem;
}

/* Chat Interface Overhaul */
.chat-interface {
    display: flex;
    flex-direction: column;
    height: 600px;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    overflow: hidden;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

.chat-container {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
.chat-container::-webkit-scrollbar {
    width: 6px;
}

.chat-container::-webkit-scrollbar-track {
    background: transparent;
}

.chat-container::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

.chat-message {
    max-width: 85%;
    display: flex;
    flex-direction: column;
    animation: messageIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

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

.chat-message.agent {
    align-self: flex-start;
}

.chat-message.user {
    align-self: flex-end;
}

.message-content {
    padding: 14px 18px;
    border-radius: 22px;
    font-size: 1rem;
    line-height: 1.6;
    letter-spacing: 0.01em;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.agent .message-content {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text);
    border-bottom-left-radius: 4px;
}

.user .message-content {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

/* Typing Indicator Animation */
.typing-dots {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: dotPulse 1.4s infinite;
}

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

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

@keyframes dotPulse {

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

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

.chat-input-area {
    padding: 20px 24px;
    display: flex;
    gap: 14px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--glass-border);
    align-items: center;
}

.chat-input-area input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 14px 22px;
    border-radius: 16px;
    color: white;
    outline: none;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-input-area input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.chat-input-area button {
    background: var(--primary);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    flex-shrink: 0;
}

.chat-input-area button:hover {
    background: var(--primary-hover);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.chat-input-area button:active {
    transform: translateY(0) scale(0.95);
}

.chat-input-area button svg {
    width: 24px;
    height: 24px;
    fill: white;
    transform: rotate(45deg);
    margin-left: -2px;
    /* Visual center adjustment for the arrow */
}

/* Chat Header Detail */
.chat-details {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.agent-avatar {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    color: white;
}

.agent-info {
    display: flex;
    flex-direction: column;
}

.agent-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.agent-status {
    font-size: 0.75rem;
    color: #10b981;
    display: flex;
    align-items: center;
    gap: 4px;
}

.agent-status::before {
    content: "";
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
}

/* Instructions Sidebar */
.instructions-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: var(--glass);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--glass-border);
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.3);
    transition: right 0.3s ease;
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
}

.instructions-sidebar.open {
    right: 0;
}

.sidebar-toggle {
    position: fixed;
    right: 0;
    top: 20px;
    width: 50px;
    height: 50px;
    background: var(--primary);
    border: none;
    border-radius: 8px 0 0 8px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 999;
}

.sidebar-toggle.open {
    right: 400px;
}

.sidebar-toggle:hover {
    background: var(--primary-hover);
    transform: translateX(-5px);
}

.sidebar-content h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: var(--text);
}

.sidebar-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.sidebar-content textarea {
    width: 100%;
    min-height: 200px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 12px;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    resize: vertical;
    margin-bottom: 15px;
}

.sidebar-content textarea::placeholder {
    color: var(--text-muted);
}

.sidebar-content textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.save-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.save-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.instructions-status {
    margin-top: 10px;
    text-align: center;
    font-size: 0.875rem;
    min-height: 20px;
}

/* Instruction Sections */
.instruction-section {
    margin-bottom: 25px;
}

.instruction-section label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.instruction-select {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    margin-bottom: 8px;
}

.instruction-select:focus {
    outline: none;
    border-color: var(--primary);
}

.instruction-select option {
    background: var(--bg-dark);
    color: var(--text);
}

.instruction-description {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    margin: 0;
    padding: 8px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 6px;
}

/* Toggle Label Styling */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.toggle-label:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
}

.toggle-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary);
}

.toggle-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}

.setting-help-standalone {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 8px 0 0 0;
    padding-left: 32px;
    line-height: 1.4;
}

/* File List Enhancements */
.file-list {
    list-style: none;
}

.file-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.file-list li:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(5px);
}

.file-name {
    flex: 1;
    color: var(--text);
    font-size: 0.9rem;
}

.file-actions {
    display: flex;
    gap: 8px;
}

.delete-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.delete-btn:hover {
    background: #dc2626;
    transform: scale(1.05);
}

.delete-btn:disabled {
    background: #6b7280;
    cursor: not-allowed;
    opacity: 0.5;
}

/* Advanced Settings */
.advanced-toggle {
    width: 100%;
    padding: 10px 15px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid var(--primary);
    border-radius: 8px;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.advanced-toggle:hover {
    background: rgba(99, 102, 241, 0.25);
}

.toggle-icon {
    transition: transform 0.3s ease;
}

.advanced-toggle.active .toggle-icon {
    transform: rotate(180deg);
}

.advanced-settings {
    margin-top: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.advanced-settings.hidden {
    display: none;
}

.setting-row {
    margin-bottom: 15px;
}

.setting-row label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 5px;
}

.setting-row input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.setting-help {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
    font-style: italic;
    margin-top: 3px;
}

.setting-input {
    width: 100%;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
}

.setting-input:focus {
    outline: none;
    border-color: var(--primary);
}

.setting-input::-webkit-inner-spin-button,
.setting-input::-webkit-outer-spin-button {
    opacity: 1;
}

/* TTS Testing Interface */
.tts-interface {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 2rem;
}

.tts-interface h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 0;
}

.tts-input-area {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tts-input-area textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    resize: vertical;
    min-height: 100px;
}

.tts-input-area textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.generate-btn {
    align-self: flex-start;
    padding: 0.75rem 2rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.generate-btn:hover:not(:disabled) {
    background: var(--primary-hover);
}

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

.tts-status {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    font-size: 0.9rem;
    min-height: 1.5rem;
}

.audio-player-container {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
}

.audio-player-container h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--text-muted);
}

.audio-player-container audio {
    width: 100%;
    margin-top: 0.5rem;
}

/* Group Selector Styles */
.group-selector-container {
    margin: 20px 0;
}

.group-selector-container label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.group-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.group-select {
    flex: 1;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
}

.group-select:focus {
    outline: none;
    border-color: var(--primary);
}

.group-select option {
    background: var(--bg-dark);
    color: var(--text);
}

.or-text {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.new-group-input {
    flex: 1;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
}

.new-group-input:focus {
    outline: none;
    border-color: var(--primary);
}

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

.filter-group {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
}

.filter-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

/* Outbound Calls Interface Styles */
.outbound-interface {
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding: 20px;
}

.outbound-header {
    text-align: center;
    margin-bottom: 10px;
}

.outbound-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    margin-bottom: 5px;
    color: var(--text);
}

.outbound-header .subtitle {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Appointment Section */
.appointment-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px;
}

.appointment-section h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--text);
}

.appointment-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
}

.appointment-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--glass-border);
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.appointment-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    transform: translateX(5px);
}

.appointment-card.selected {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

.appointment-info {
    flex: 1;
}

.appointment-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 5px;
}

.appointment-time {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 3px;
}

.appointment-phone {
    font-size: 0.85rem;
    color: #60a5fa;
    font-family: monospace;
}

.appointment-status {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.appointment-status.pending {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.appointment-status.completed {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

/* Call Configuration Section */
.call-config-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px;
}

.call-config-section h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--text);
}

.config-field {
    margin-bottom: 15px;
}

.config-field label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.config-select,
.config-input {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
}

.config-select:focus,
.config-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
}

.config-select option {
    background: var(--bg-dark);
    color: var(--text);
}

.call-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

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

.call-btn:disabled {
    background: #6b7280;
    cursor: not-allowed;
    opacity: 0.5;
}

.hangup-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.hangup-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

.hangup-btn.hidden {
    display: none;
}

/* Call Status Container */
.call-status-container {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.status-badge {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    background: rgba(107, 114, 128, 0.3);
    color: #9ca3af;
    margin-bottom: 10px;
}

.status-badge.connecting {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.status-badge.connected {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.status-badge.error {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.call-details {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 10px;
    line-height: 1.6;
}

/* Utility Classes */
.text-muted {
    color: var(--text-muted);
}

.text-primary {
    color: var(--primary);
}

.text-success {
    color: #10b981;
}

.text-error {
    color: #ef4444;
}

/* Voice Selection Status */
.voice-status {
    margin-top: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    font-size: 0.85rem;
    text-align: center;
    display: none;
    animation: fadeIn 0.3s ease;
}

/* Gender indicator badges in voice description */
.voice-description-gender {
    display: inline-block;
    padding: 2px 8px;
    margin-right: 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.voice-description-gender.male {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.voice-description-gender.female {
    background: rgba(236, 72, 153, 0.2);
    color: #f472b6;
}

/* ─── Playbooks Tab ────────────────────────────────────────────────────────── */

.playbooks-interface {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 0;
}

.playbook-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.playbook-empty {
    color: var(--text-muted);
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 0;
    font-size: 0.95rem;
}

.playbook-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color 0.2s, transform 0.2s;
}

.playbook-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.playbook-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.playbook-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.playbook-version {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    padding-top: 2px;
}

.playbook-description {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
    flex: 1;
}

.playbook-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.playbook-tag {
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-muted);
}

.playbook-tag--tools {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.playbook-tag--rag {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
}

.use-playbook-btn {
    margin-top: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    border: none;
    background: var(--primary);
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}

.use-playbook-btn:hover {
    opacity: 0.85;
    transform: scale(1.02);
}
