/* --- AI Debater Specific Styles --- */
/* NEPP Clean Dark Aesthetics */

:root {
    --bg-dark: #101622;
    --bg-panel: #101b28;
    --gold-primary: #E5C100;
    --text-main: #ffffff;
    --text-muted: #94A3B8;
    --border-dim: rgba(255, 255, 255, 0.08);
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
}

/* Base Buttons */
.base-btn {
    padding: 10px 24px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.primary-btn {
    background: var(--gold-primary);
    color: #000;
}

.primary-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(229, 193, 0, 0.3);
}

.danger-btn {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.danger-btn:hover {
    background: rgba(239, 68, 68, 0.2);
}

.subtle-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border-dim);
}

.subtle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.cancel-btn {
    background: transparent;
    color: var(--text-muted);
}

.cancel-btn:hover {
    color: var(--text-main);
}

.icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.mic-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-dim);
    color: var(--text-main);
}

.mic-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mic-btn.recording {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.5);
    animation: pulseMic 1.5s infinite;
}

@keyframes pulseMic {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

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

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

/* Glass Card Reusable */
.glass-card {
    background: rgba(16, 27, 40, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-dim);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Layout */
.debater-container {
    padding-top: 120px;
    padding-bottom: 60px;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    justify-content: center;
}

/* Setup View */
.setup-container {
    display: flex;
    gap: 32px;
    width: 100%;
    align-items: flex-start;
}

.setup-card {
    flex: 2;
    padding: 40px;
}

.setup-header {
    margin-bottom: 32px;
}

.setup-header h2 {
    margin: 0 0 8px 0;
    font-size: 2rem;
    color: var(--text-main);
    font-weight: 700;
}

.setup-header p {
    margin: 0;
    color: var(--text-muted);
}

.form-group {
    margin-bottom: 24px;
}

.split-form {
    display: flex;
    gap: 24px;
}

.split-form .form-group {
    flex: 1;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-dim);
    border-radius: 8px;
    padding: 16px;
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--gold-primary);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

.setup-actions {
    margin-top: 40px;
    display: flex;
    justify-content: flex-end;
}

.history-sidebar {
    flex: 1;
    padding: 24px;
    min-width: 300px;
}

.history-sidebar h3 {
    margin: 0 0 16px 0;
    font-size: 1.1rem;
    color: var(--gold-primary);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-dim);
    padding: 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.empty-state {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.9rem;
}

/* Arena View */
.arena-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 24px;
    height: calc(100vh - 160px);
}

.arena-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
}

.arena-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.badges {
    display: flex;
    gap: 8px;
}

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.format-badge {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.side-badge {
    background: rgba(229, 193, 0, 0.15);
    color: var(--gold-primary);
}

.resolution-title {
    font-weight: 600;
    color: var(--text-main);
    font-size: 1.1rem;
}

.phase-display {
    text-align: center;
}

.phase-display .label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.1em;
}

.highlight-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold-primary);
}

/* Chat Engine */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.message {
    display: flex;
    gap: 16px;
    max-width: 85%;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message.ai {
    align-self: flex-start;
}

.message.system {
    align-self: center;
    max-width: 100%;
    justify-content: center;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.user .avatar {
    background: rgba(255, 255, 255, 0.1);
}

.ai .avatar {
    background: rgba(229, 193, 0, 0.2);
}

.system .avatar {
    display: none;
}

.bubble {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-dim);
    padding: 16px 20px;
    border-radius: 12px;
    font-size: 1rem;
    line-height: 1.5;
}

.user .bubble {
    background: rgba(255, 255, 255, 0.05);
    border-top-right-radius: 0;
}

.ai .bubble {
    background: rgba(16, 27, 40, 0.8);
    border-color: rgba(229, 193, 0, 0.3);
    border-top-left-radius: 0;
}

.system .bubble {
    background: transparent;
    border: none;
    padding: 0;
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.9rem;
}

/* Input Area */
.chat-input-area {
    padding: 16px;
    position: relative;
    display: flex;
    flex-direction: column;
}

.input-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-dim);
}

.typing-indicator {
    color: var(--gold-primary);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.spinner {
    animation: rotate 2s linear infinite;
    width: 18px;
    height: 18px;
}

.spinner .path {
    stroke: var(--gold-primary);
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }

    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }

    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

.input-row {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 16px;
}

.message-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-dim);
    border-radius: 8px;
    padding: 16px;
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
    resize: none;
}

.message-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.3);
}

.action-buttons {
    display: flex;
    gap: 12px;
}

/* Transcription Overlay */
.live-transcription {
    position: absolute;
    bottom: 90px;
    left: 24px;
    right: 24px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-dim);
    padding: 16px;
    border-radius: 8px;
    color: var(--gold-primary);
    font-style: italic;
    z-index: 10;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-content {
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

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

.modal-header h2 {
    margin: 0;
    color: var(--gold-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    font-size: 1rem;
    line-height: 1.6;
}

.modal-footer {
    padding: 24px;
    border-top: 1px solid var(--border-dim);
    display: flex;
    justify-content: flex-end;
}