/* ============ App Layout ============ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ============ Sidebar ============ */
.sidebar {
    width: 240px;
    background: #111113;
    border-right: 1px solid rgba(255,255,255,0.06);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px 16px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-logo {
    max-width: 160px;
    height: auto;
    display: block;
    margin-bottom: 8px;
}

.sidebar-user {
    font-size: 0.8rem;
}

.sidebar-nav {
    padding: 12px 8px;
    flex: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    color: #9ca3af;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.15s ease;
    margin-bottom: 2px;
}

.sidebar-link:hover {
    color: #e5e7eb;
    background: rgba(255,255,255,0.05);
}

.sidebar-link.active {
    color: #fff;
    background: rgba(255,255,255,0.08);
}

.sidebar-link i {
    width: 18px;
    text-align: center;
    font-size: 0.95rem;
}

.sidebar-footer {
    padding: 12px 8px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* ============ Main Content ============ */
.main-content {
    flex: 1;
    margin-left: 240px;
    padding: 24px 32px;
    min-height: 100vh;
}

.flash-messages {
    margin-bottom: 16px;
}

/* ============ Auth Pages ============ */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #0d0d0f;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.auth-card {
    background: #18181b;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 32px;
}

/* ============ Dashboard ============ */
.dashboard-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.project-section {
    margin-bottom: 24px;
    background: #18181b;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    overflow: hidden;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.conversation-list {
    padding: 0;
}

.conversation-card {
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background 0.15s ease;
}

.conversation-card:last-child {
    border-bottom: none;
}

.conversation-card:hover {
    background: rgba(255,255,255,0.03);
}

.conversation-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    padding: 12px 18px;
    text-decoration: none;
    color: inherit;
}

.conversation-link:hover {
    color: inherit;
}

.conversation-info {
    flex: 1;
}

.conversation-title {
    font-weight: 500;
    margin-bottom: 2px;
}

.conversation-meta {
    font-size: 0.8rem;
    color: #6b7280;
}

.conversation-actions {
    padding-right: 12px;
    position: relative;
    z-index: 2;
}

.conversation-actions .dropdown-menu {
    z-index: 1050;
}

.empty-project {
    padding: 20px;
    text-align: center;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
}

/* ============ New Conversation Modal ============ */
.input-option-card {
    background: #1e1e22;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.input-option-card:hover {
    border-color: rgba(99, 102, 241, 0.4);
    background: #222228;
    transform: translateY(-2px);
}

.input-option-card.selected {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.08);
}

.input-section {
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* ============ Analysis Page (legacy support) ============ */
.card {
    transition: transform 0.2s ease-in-out;
}

#triangle-canvas {
    background: var(--bs-dark);
    cursor: crosshair;
    max-width: 100%;
    height: auto;
}

#triangle-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 500px;
}

.utterance-item {
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    border: 1px solid transparent;
}

.utterance-item:hover {
    border-color: var(--bs-primary);
    transform: translateX(5px);
}

.utterance-item.highlighted {
    border-color: var(--bs-warning);
    background-color: var(--bs-warning) !important;
    background-opacity: 0.2 !important;
}

#timeline-slider { cursor: pointer; }
#timeline-slider::-webkit-slider-thumb { background: var(--bs-primary); cursor: pointer; }
#timeline-slider::-moz-range-thumb { background: var(--bs-primary); cursor: pointer; }

#current-utterance-display {
    transition: all 0.3s ease-in-out;
    min-height: 100px;
}

#play-pause-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    transition: all 0.2s ease-in-out;
}

#play-pause-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.4);
}

.progress { background-color: var(--bs-dark); }

.form-control:focus {
    border-color: var(--bs-info);
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-info-rgb), 0.25);
}

.alert { border: none; border-radius: 0.5rem; }
.badge { font-size: 0.75em; font-weight: 500; }

.voice-inquire { color: var(--bs-primary); }
.voice-diagnose { color: var(--bs-success); }
.voice-challenge { color: var(--bs-warning); }
.voice-advise { color: var(--bs-info); }
.voice-evaluate { color: var(--bs-secondary); }

.pressure-zone {
    background-color: var(--bs-danger) !important;
    background-opacity: 0.2 !important;
    border-left: 3px solid var(--bs-danger);
}

.triangle-legend {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    padding: 10px;
    border-radius: 5px;
    font-size: 12px;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--bs-secondary);
    border-radius: 50%;
    border-top-color: var(--bs-primary);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.tooltip-inner {
    background-color: var(--bs-dark);
    color: var(--bs-light);
    font-size: 0.875rem;
    max-width: 300px;
}

.voice-chart { height: 200px; position: relative; }

.clickable { cursor: pointer; transition: opacity 0.2s ease; }
.clickable:hover { opacity: 0.8; }

.summary-card {
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
}

.flow-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin: 0 2px;
}

.flow-good { background-color: var(--bs-success); }
.flow-neutral { background-color: var(--bs-warning); }
.flow-poor { background-color: var(--bs-danger); }

/* ============ Responsive ============ */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    .sidebar-logo { max-width: 40px; }
    .sidebar-user { display: none; }
    .sidebar-link span { display: none; }
    .sidebar-link { justify-content: center; padding: 10px; }
    .main-content { margin-left: 60px; padding: 16px; }

    #triangle-canvas { width: 100%; height: 400px; }
    .display-4 { font-size: 2rem; }
}
