/* --- Global Styles & Theme --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Roboto+Mono:wght@500&display=swap');

:root {
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'Roboto Mono', monospace;

    --bg-color: #f7f8fc;
    --panel-bg: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #8492a6;
    --border-color: #e0e6ed;
    
    --accent-gradient: linear-gradient(135deg, #4a00e0, #8e2de2);
    --accent-primary: #4a00e0;
    --accent-hover: #3a00b0;
    --success-color: #10b981;
    --success-hover: #059669;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    
    --highlight-bg: #fffbe6;
    --highlight-border: #facc15;
    
    --shadow-sm: 0 2px 8px rgba(18, 45, 71, 0.06);
    --shadow-md: 0 4px 16px rgba(18, 45, 71, 0.08);
    --shadow-lg: 0 10px 30px rgba(18, 45, 71, 0.12);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

/* general body styling */
body {
    font-family: var(--font-main);
    margin: 0;
    padding: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    background-color: var(--bg-color);
    overflow: hidden;
    color: var(--text-primary);
}

/* header styling */
.header {
    width: 100%;
    text-align: center;
    padding: 1.5rem 2rem;
    background-color: var(--panel-bg);
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
    box-sizing: border-box;
    position: relative;
    border-bottom: 1px solid var(--border-color);
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

/* selection row styling */
.selection-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.selection-row > div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
}

.selection-row label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.selection-row input,
.selection-row select {
    padding: 0.6rem 0.9rem;
    font-size: 0.95rem;
    font-family: var(--font-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--panel-bg);
    color: var(--text-primary);
    min-width: 140px;
    transition: all 0.2s ease;
}

.selection-row input:focus,
.selection-row select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(74, 0, 224, 0.1);
}

/* form container */
.signin-form {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-end;
}

/* first row: email, password, and button */
.form-row {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* signin input fields */
.signin-input {
    padding: 0.6rem 0.9rem;
    font-size: 0.95rem;
    font-family: var(--font-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    outline: none;
    background-color: var(--panel-bg);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.signin-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(74, 0, 224, 0.1);
}

/* signin button */
.signin-btn {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.signin-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.signin-btn:active {
    transform: translateY(0);
}

/* second row: switch link */
.form-link-row {
    display: flex;
    justify-content: flex-end;
}

/* form link */
.form-link {
    font-size: 0.85rem;
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.form-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* user email display */
.user-email {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* wrapper for password input and eye icon */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

/* eye icon inside password input */
.password-wrapper i {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.password-wrapper i:hover {
    color: var(--text-primary);
}

/* main container style */
.container {
    width: 100%;
    max-width: 1400px;
    height: calc(100vh - 140px);
    display: flex;
    justify-content: space-between;
    padding: 0 2rem 2rem 2rem;
    box-sizing: border-box;
    overflow: hidden;
}

/* layout for content split between Part A and Part B */
.content {
    display: flex;
    width: 100%;
    height: 100%;
    gap: 1.5rem;
}

/* Part A styling (left side, transcription + assistant call) */
.part-a {
    width: 66.66%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    gap: 1.5rem;
}

/* transcription screen takes 3/4 of part-a height */
.transcription-screen {
    height: 73%;
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-md);
}

/* transcription header with red and black buttons */
.transcription-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.25rem 1.5rem;
    position: sticky;
    top: 0;
    background-color: var(--panel-bg);
    z-index: 1;
    border-bottom: 1px solid var(--border-color);
}

/* controls (title and buttons) centered */
.transcription-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3rem;
}

.transcription-controls h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* red start button on the left */
.start-button {
    width: 28px;
    height: 28px;
    background-color: var(--danger-color);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.start-button:hover {
    background-color: #dc2626;
    transform: scale(1.1);
}

.start-button:disabled {
    background-color: #fca5a5;
    cursor: not-allowed;
    transform: scale(1);
}

/* black stop button on the right */
.stop-button {
    width: 28px;
    height: 28px;
    background-color: var(--text-primary);
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.stop-button:hover {
    background-color: #1a202c;
    transform: scale(1.1);
}

.stop-button:disabled {
    background-color: #cbd5e0;
    cursor: not-allowed;
    transform: scale(1);
}

/* divider line below the transcription header */
.divider {
    border: 0;
    height: 1px;
    background-color: var(--border-color);
    margin: 0;
}

/* transcription content box with auto-scroll */
.transcription-content {
    flex-grow: 1;
    padding: 1.5rem;
    overflow-y: auto;
    line-height: 1.7;
    position: relative;
}

.transcription-content p {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
}

/* Individual transcript entry */
.transcript-entry {
    display: flex;
    margin: 1.5rem 0;
    gap: 0.75rem;
    align-items: flex-end;
    position: relative;
    max-width: 85%;
}

.transcript-entry:first-child {
    margin-top: 0;
}

/* You messages aligned left */
.speaker-you,
.speaker-ai-instruction {
    align-self: flex-start;
}

/* Others aligned right */
.speaker-other,
.speaker-system {
    align-self: flex-end;
    flex-direction: row-reverse;
}

/* Speaker avatar */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Different colors for different speakers */
.speaker-you .avatar,
.speaker-ai-instruction .avatar {
    background: var(--accent-gradient);
}

.speaker-other .avatar {
    background-color: #64748b;
}

.speaker-system .avatar {
    background-color: #f59e0b;
}

/* Speech bubble container */
.speech-bubble {
    flex: 1;
    min-width: 0;
}

.speaker-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

/* Align speaker info based on side */
.speaker-you .speaker-info,
.speaker-ai-instruction .speaker-info {
    justify-content: flex-start;
}

.speaker-other .speaker-info,
.speaker-system .speaker-info {
    justify-content: flex-end;
}

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

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

.message {
    line-height: 1.6;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin: 0;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Message bubble styling for You */
.speaker-you .message,
.speaker-ai-instruction .message {
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    border-bottom-left-radius: 4px;
}

/* Message bubble styling for Others */
.speaker-other .message,
.speaker-system .message {
    background-color: #f1f5f9;
    border-bottom-right-radius: 4px;
}

/* Special styling for AI instruction messages */
.speaker-ai-instruction .message {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-left: 3px solid #f59e0b;
}

/* call assistant section takes 1/4 of part-a height */
.call-assistant {
    height: 25%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.25rem;
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

/* row with dropdown for assistant selection */
.call-row {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
}

/* assistant selection dropdown */
.assistant-selection {
    flex: 1;
    padding: 0.7rem 0.9rem;
    font-size: 0.95rem;
    font-family: var(--font-main);
    cursor: pointer;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--panel-bg);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.assistant-selection:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(74, 0, 224, 0.1);
}

/* user input row for instruction input and buttons */
.input-row {
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
}

/* instruction input styling for the textarea */
.instruction-container {
    display: flex;
    flex: 2;
}

.instruction-input {
    flex: 9;
    padding: 0.9rem;
    font-size: 0.95rem;
    font-family: var(--font-main);
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    border: 1px solid var(--border-color);
    border-right: none;
    height: 100px;
    resize: none;
    overflow: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.6;
    transition: all 0.2s ease;
}

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

.mic-btn {
    flex: 1;
    background: var(--success-color);
    color: white;
    border: 1px solid var(--border-color);
    border-left: none;
    cursor: pointer;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.mic-btn:hover {
    background: var(--success-hover);
}

.mic-btn img {
    width: 22px;
    height: 22px;
}

/* Ask AI button with gradient */
.confirm-btn {
    padding: 0.9rem 1.5rem;
    background: var(--accent-gradient);
    color: white;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-sm);
    min-width: 100px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.confirm-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Reset button */
.reset-btn {
    padding: 0.9rem 1.5rem;
    background-color: var(--text-secondary);
    color: white;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-sm);
    min-width: 100px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.reset-btn:hover {
    background-color: #6b7280;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* style for disabled buttons */
button:disabled {
    background-color: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    border: 1px solid var(--border-color);
    pointer-events: none;
    transform: none !important;
    box-shadow: none !important;
}

/* Part B styling (right side, Assistant Response) */
.part-b {
    width: 33.33%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-md);
}

/* assistant response header */
.response-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.25rem 1.5rem;
    position: sticky;
    top: 0;
    background-color: var(--panel-bg);
    z-index: 1;
    border-bottom: 1px solid var(--border-color);
}

.response-header h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* assistant response content with auto-scroll */
.response-content {
    flex-grow: 1;
    padding: 1.5rem;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.7;
    color: var(--text-primary);
}

/* positioning for the page navigation buttons inside response screen */
.page-navigation {
    position: absolute;
    bottom: 1.25rem;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 1.5rem;
    box-sizing: border-box;
}

/* styling for navigation buttons */
.nav-button {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 0.7rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.nav-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.nav-button:disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    transform: none !important;
}

/* sidebar styling */
.sidebar {
    width: 0;
    height: 100%;
    background-color: var(--panel-bg);
    position: fixed;
    top: 0;
    left: 0;
    overflow-x: hidden;
    transition: width 0.3s ease;
    padding-top: 1.5rem;
    z-index: 999;
    box-shadow: var(--shadow-lg);
    border-right: 1px solid var(--border-color);
}

.sidebar.active {
    width: 280px;
}

.sidebar-content {
    padding: 1.5rem;
    color: var(--text-primary);
}

.sidebar h2 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    font-weight: 600;
}

.sidebar ul {
    list-style: none;
    padding: 0;
}

.sidebar ul li {
    padding: 0.9rem;
    background-color: var(--bg-color);
    margin-bottom: 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-primary);
    position: relative;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.sidebar ul li:hover {
    background-color: #eef2ff;
    border-color: var(--accent-primary);
}

/* arrow, title, and plus button container */
.series-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.arrow {
    font-size: 1rem;
    margin-right: 0.75rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.series-title {
    flex-grow: 1;
    cursor: pointer;
    font-weight: 500;
}

/* plus button styling */
.plus-btn {
    background: var(--success-color);
    color: white;
    border: none;
    padding: 0.4rem 0.75rem;
    font-size: 1.1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    margin-left: 0.75rem;
    transition: all 0.2s ease;
    line-height: 1;
}

.plus-btn:hover {
    background: var(--success-hover);
    transform: scale(1.05);
}

/* styling for nested meeting lists */
.sidebar ul li ul {
    margin-left: 1.5rem;
    list-style-type: none;
}

.create-btn {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    width: 100%;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

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

/* sidebar toggle button */
.sidebar-toggle {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 1.5rem;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1000;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
}

.sidebar-toggle:hover {
    transform: scale(1.05);
}

/* modal styling */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--panel-bg);
    padding: 2rem;
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    text-align: left;
    animation: slideIn 0.3s ease;
    border: 1px solid var(--border-color);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* modal heading */
.modal-content h3 {
    margin-top: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

/* modal labels */
.modal-content label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* input fields */
.modal-content input,
.modal-content textarea {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: var(--font-main);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

/* on focus, change border color */
.modal-content input:focus,
.modal-content textarea:focus {
    border-color: var(--accent-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 0, 224, 0.1);
}

/* date input adjustment */
#meetingTime {
    padding: 0.75rem;
}

/* button styling */
.modal-content button {
    width: 100%;
    padding: 0.9rem;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.modal-content button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* main content styling when sidebar is active */
.main-content {
    margin-left: 0;
    transition: margin-left 0.3s;
    flex: 1;
}

.sidebar.active + .main-content {
    margin-left: 280px;
}

/* default styles for non-active meeting items */
.meeting-item {
    background-color: var(--bg-color);
    color: var(--text-primary);
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.meeting-item:hover {
    background-color: #eef2ff;
    border-color: var(--accent-primary);
}

/* highlight the selected (active) meeting */
.meeting-item.active,
.meeting-item.selected {
    background: var(--accent-gradient);
    color: white;
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    transition: all 0.2s ease;
    border-color: transparent;
}

/* Custom scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}