:root {
    --primary-color: #6200ea;
    /* Deep Purple */
    --primary-light: #b388ff;
    --primary-dark: #4a0072;
    --secondary-color: #00bfa5;
    /* Teal */
    --bg-color: #f9fafb;
    /* Lighter, cleaner gray */
    --surface-color: #ffffff;
    --text-primary: #111827;
    /* Darker gray for better contrast */
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Auth Overlay --- */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.auth-card {
    background: var(--surface-color);
    padding: 3rem;
    border-radius: 1.5rem;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.brand-logo {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.subtitle {
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.auth-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s;
    background: #f9fafb;
}

.auth-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(98, 0, 234, 0.1);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 0.95rem;
    gap: 0.5rem;
    letter-spacing: 0.01em;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 6px rgba(98, 0, 234, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px rgba(98, 0, 234, 0.3);
}

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

.btn-secondary:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: 0.5rem;
}

.footer-text {
    margin-top: 2rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.footer-text a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

/* --- App Layout --- */
.app-container {
    display: grid;
    grid-template-columns: 260px 1fr 320px;
    /* Sidebar | Main | Right Panel */
    height: 100vh;
}

/* Sidebar */
.sidebar {
    background: var(--surface-color);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
    color: var(--primary-color);
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: -0.02em;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    overflow-y: auto;
    /* Allow scrolling if menu is tall */
    min-height: 0;
    /* Required for flex scrolling */
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-item:hover {
    background-color: #f9fafb;
    color: var(--text-primary);
}

.nav-item.active {
    background-color: #f3e8ff;
    color: var(--primary-color);
    font-weight: 600;
}

.sidebar-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.user-mini-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 2px 4px rgba(98, 0, 234, 0.2);
}

.user-details {
    display: flex;
    flex-direction: column;
}

.email-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.role-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.btn-icon:hover {
    background-color: #fee2e2;
    color: #ef4444;
}

/* Main Content */
.main-content {
    background: var(--bg-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-bar {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    padding: 1rem 2.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}

.search-bar {
    display: flex;
    align-items: center;
    background: white;
    padding: 0.6rem 1rem;
    border-radius: 0.75rem;
    width: 420px;
    gap: 0.75rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.search-bar:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(98, 0, 234, 0.05);
}

.search-bar input {
    border: none;
    background: none;
    width: 100%;
    outline: none;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.top-actions {
    display: flex;
    gap: 1rem;
}

.content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 2.5rem;
}

.greeting-section {
    margin-bottom: 3rem;
}

.greeting-section h1 {
    font-size: 2rem;
    margin-bottom: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.quick-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.stat-card {
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    border: 1px solid var(--border-color);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    padding: 0.875rem;
    border-radius: 1rem;
    background: #f3f4f6;
}

.stat-icon.orange {
    color: #f59e0b;
    background: #fffbeb;
}

.stat-icon.green {
    color: #10b981;
    background: #ecfdf5;
}

.stat-icon.purple {
    color: #8b5cf6;
    background: #f5f3ff;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.view-toggles {
    display: flex;
    gap: 0.25rem;
    background: white;
    padding: 0.25rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.view-toggles span {
    padding: 0.35rem 0.5rem;
    border-radius: 0.35rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.view-toggles span.active {
    background: #f3f4f6;
    color: var(--primary-color);
}

.meetings-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Meeting Card (Redesigned) */
.meeting-card {
    background: var(--surface-color);
    border-radius: 1.25rem;
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.meeting-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: #d1d5db;
    transform: translateY(-1px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.meeting-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.meeting-meta {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sentiment-badge {
    padding: 0.35rem 0.875rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sentiment-positive {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.sentiment-neutral {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.sentiment-negative {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.card-content {
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.summary-text {
    font-size: 1rem;
    line-height: 1.6;
    color: #374151;
    margin-bottom: 1.5rem;
}

/* Details & Summary */
details summary {
    list-style: none;
    cursor: pointer;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

details summary::-webkit-details-marker {
    display: none;
}

details summary:hover {
    text-decoration: underline;
}

.key-points {
    list-style-position: outside;
    margin-left: 1.25rem;
    color: #374151;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.key-points li {
    margin-bottom: 0.5rem;
}

.card-actions {
    display: flex;
    gap: 1rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    margin-top: 1.5rem;
}

/* Right Panel */
.right-panel {
    background: var(--surface-color);
    border-left: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.panel-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.calendar-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    overflow-y: auto;
}

.calendar-event {
    background: #f9fafb;
    padding: 1.25rem;
    border-radius: 1rem;
    border-left: 4px solid var(--primary-color);
    transition: all 0.2s;
    border: 1px solid transparent;
}

.calendar-event:hover {
    background: white;
    border-color: var(--border-color);
    box-shadow: var(--shadow-sm);
}

.event-time {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
    font-weight: 500;
}

.event-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.event-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e5e7eb;
    transition: .3s;
    border-radius: 22px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

input:checked+.slider {
    background-color: var(--primary-color);
}

input:checked+.slider:before {
    transform: translateX(18px);
}

/* Dropdown Styles */
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
    width: 240px;
    z-index: 100;
    padding: 0.5rem 0;
    animation: fadeIn 0.1s ease-out;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: #f9fafb;
    color: var(--primary-color);
}

.dropdown-item .material-icons-round {
    font-size: 1.25rem;
    color: var(--text-secondary);
}

.dropdown-item:hover .material-icons-round {
    color: var(--primary-color);
}

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

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

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(2px);
}

.modal-card {
    background: white;
    border-radius: 1rem;
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.2s ease-out;
}

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

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-body {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon .material-icons-round {
    position: absolute;
    left: 1rem;
    color: var(--text-secondary);
}

.input-with-icon input {
    padding-left: 3rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* Processing State */
.processing-card {
    border-left: 4px solid var(--text-secondary);
}

.processing-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-secondary);
    text-align: center;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 1rem;
}

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

/* --- Meeting Detail View (Fireflies Style) --- */
.meeting-detail-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--bg-color);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 20; /* Above content-scroll */
}

.detail-header {
    background: white;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-info h1 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.header-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.detail-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Left Panel: Summary */
.summary-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    background: white;
}

.panel-tabs {
    display: flex;
    gap: 1.5rem;
    padding: 0 2rem;
    border-bottom: 1px solid var(--border-color);
    background: #f9fafb;
}

.tab-btn {
    background: none;
    border: none;
    padding: 1rem 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
}

.tab-btn.active {
    color: var(--primary-color);
    font-weight: 600;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
}

.panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

/* Right Panel: Transcript */
.transcript-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
}

.transcript-search {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
}

.transcript-search input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 0.95rem;
}

.transcript-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

/* Transcript Bubbles */
.transcript-bubble {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.speaker-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #e0e7ff;
    color: #4338ca;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.bubble-content {
    flex: 1;
}

.bubble-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

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

.timestamp {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.bubble-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #374151;
}

/* Markdown Styles in Summary */
.panel-body h1, .panel-body h2, .panel-body h3 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.panel-body ul {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.panel-body li {
    margin-bottom: 0.5rem;
    color: #4b5563;
}

.panel-body p {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: #4b5563;
}

/* --- Audio Player Footer --- */
.detail-footer {
    background: white;
    border-top: 1px solid var(--border-color);
    padding: 1rem 2rem;
    flex-shrink: 0; /* Don't shrink */
}

.audio-player-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.player-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(98, 0, 234, 0.2);
    transition: transform 0.1s;
}

.player-btn:active {
    transform: scale(0.95);
}

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

.time-display {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    min-width: 80px;
}

.progress-bar-container {
    flex: 1;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: var(--primary-color);
    border-radius: 3px;
    width: 0%;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    right: -6px;
    top: -3px;
    width: 12px;
    height: 12px;
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
}

.progress-bar-container:hover .progress-bar::after {
    opacity: 1;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.player-btn-sm {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.5rem;
    border-radius: 0.5rem;
}

.player-btn-sm:hover {
    background: #f3f4f6;
    color: var(--primary-color);
}

/* --- Notes Tab --- */
.notes-editor {
    width: 100%;
    height: 100%;
    border: none;
    resize: none;
    outline: none;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    background: transparent;
}

.empty-state-small {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
    font-size: 0.9rem;
}
