/* style.css - Light Theme (Animated Summary Items) */
:root {
    --font-family-sans-serif: "Google Sans", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-family-monospace: "Roboto Mono", SFMono-Regular, Menlo, Monaco, Consolas, monospace;

    /* Light Theme Palette */
    --bg-color-light-primary: #f8f9fa;
    --bg-color-light-secondary: #ffffff;
    --bg-color-light-tertiary: #e9ecef;
    --bg-color-light-quaternary: #dee2e6;
    
    --text-color-light-primary: #212529;
    --text-color-light-secondary: #495057;
    --text-color-light-disabled: #6c757d;

    --accent-color-blue: #0d6efd;
    --accent-color-blue-darker: #0a58ca; 
    --accent-color-blue-text: #ffffff;
    --accent-color-red: #dc3545;
    --accent-color-red-darker: #b02a37;
    --accent-color-red-bg-light: #fdf3f2;
    --accent-color-green-check: #28a745;
    --accent-color-soft-blue1: #e0f0ff; 
    --accent-color-soft-blue2: #cce4ff; 
    
    /* Added yellow for thunderbolt glow */
    --accent-color-yellow-glow: #FFD700;
    --accent-color-yellow-glow-outer: orange;


    --box-shadow-sm: 0 .125rem .25rem rgba(0,0,0,.075);
    --box-shadow-md: 0 .5rem 1rem rgba(0,0,0,.1);
    --box-shadow-lg-header: 0 4px 12px rgba(0, 0, 0, 0.08); 


    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    
    /* Decoupled Header and Logo Sizing */
    --header-height: 70px;
    --logo-height: 120px; 
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px; 
    height: 100%; 
}

body {
    font-family: var(--font-family-sans-serif);
    color: var(--text-color-light-primary);
    line-height: 1.5;
    display: flex; 
    flex-direction: column; 
    min-height: 100%; 
    overflow-x: hidden; 
    position: relative; /* Needed for z-index context of canvas */
    background-color: var(--bg-color-light-primary);
    background-image:
        radial-gradient(circle at 1px 1px, rgba(206, 212, 218, 0.7) 1px, transparent 0);
    background-size: 28px 49px;
}

/* Canvas for spark animation */
#spark-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; 
    pointer-events: none;
}


.app-container-no-sidebar {
    display: flex;
    flex-direction: column;
    flex-grow: 1; 
    width: 100%;
}

.app-main-full-width {
    flex-grow: 1; 
    display: flex;
    flex-direction: column;
    width: 100%;
}

.main-header {
    display: flex;
    justify-content: space-between; 
    align-items: center;
    padding: 0 2rem; 
    background-color: var(--bg-color-light-secondary);
    border-bottom: 1px solid var(--bg-color-light-quaternary);
    flex-shrink: 0; 
    box-shadow: var(--box-shadow-lg-header); 
    width: 100%;
    position: sticky; 
    top: 0;
    z-index: 970; 
    overflow: hidden;
    height: var(--header-height);
}

/* --- NEW HEADER ANIMATION --- */

/* Part 1: Left Document Animation */
@keyframes animateDocLeft {
    0% { left: -50px; opacity: 0; }
    35% { left: 50%; transform: translateX(-50%); opacity: 1; }
    42% { left: 50%; transform: translateX(-50%); opacity: 0; }
    100% { opacity: 0; }
}

/* Part 1: Right Document Animation */
@keyframes animateDocRight {
    0% { right: -50px; opacity: 0; }
    35% { right: 50%; transform: translateX(50%); opacity: 1; }
    42% { right: 50%; transform: translateX(50%); opacity: 0; }
    100% { opacity: 0; }
}

/* Part 2: Thunderbolt Icon Animation (Desktop) */
@keyframes animateThunderbolt {
    0%, 41% {
        transform: translate(calc(50vw - 2rem), 10px) scale(0);
        opacity: 0;
    }
    43% {
        transform: translate(calc(50vw - 2rem), 10px) scale(2);
        opacity: 1;
    }
    70% {
        transform: translate(80px, 18px) scale(0);
        opacity: 0;
    }
    100% { opacity: 0; }
}

/* Part 3: Logo Gradient Wipe Animation */
@keyframes animateLogoWipe {
    0%, 70% {
        /* MODIFICATION: Increased distance to ensure highlight is off-screen */
        background-position: -200% 0; 
        transform: scale(1);
    }
    71% {
        transform: scale(1.2); /* Zoom in on impact */
    }
    88% {
        /* MODIFICATION: Increased distance to ensure highlight is off-screen */
        background-position: 200% 0; 
        transform: scale(1.1);
    }
    90%, 100% {
        transform: scale(1);
    }
}

/* Actor 1: The Documents */
.main-header::before,
.main-header::after {
    content: '';
    position: absolute;
    width: 28px;
    height: 28px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 18"><path fill="%230d6efd" d="M13 5.5L8.5 1H2v16h11V5.5z"/><path fill="%23cce4ff" d="M12.5 6H8V1.5L12.5 6z"/></svg>');
    background-size: contain;
    z-index: 1;
    top: 20px;
    opacity: 0;
    animation-duration: 7s;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
}
.main-header::before {
    animation-name: animateDocLeft;
}
.main-header::after {
    animation-name: animateDocRight;
}

.header-title-area {
    position: relative; 
    z-index: 3;
}

/* Actor 2: The Thunderbolt */
.header-title-area::before {
    content: '⚡';
    position: absolute;
    z-index: 2;
    top: 0;
    left: 0;
    font-size: 32px;
    color: var(--accent-color-yellow-glow);
    text-shadow: 0 0 5px var(--accent-color-yellow-glow), 0 0 15px var(--accent-color-yellow-glow-outer);
    transform-origin: center;
    opacity: 0;
    animation: animateThunderbolt 7s infinite ease-out;
}

.header-actions {
    height: 100%;
    display: flex;
    align-items: center;
    position: relative; 
    z-index: 2; 
}

/* Actor 3: The Logo */
.main-title { 
    font-size: 1.9rem; 
    font-weight: 700;
    margin: 0; 
    padding-bottom: 4px; 
    position: relative;
    z-index: 4; /* On top of everything */

    background: linear-gradient(
        90deg, 
        var(--accent-color-blue) 40%, 
        var(--accent-color-yellow-glow) 50%, 
        var(--accent-color-blue) 60%
    );
    /* MODIFICATION: Increased background size to give more padding */
    background-size: 300% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    
    animation: animateLogoWipe 7s infinite ease-in-out;
}

.app-logo { 
    height: var(--logo-height);
    max-height: 180%; 
    width: 250px; 
    transition: filter 0.3s ease;
    cursor: pointer; 
    transform: translateX(50px);
}
.app-logo:hover {
    filter: brightness(1.05);
}
/* --- END OF NEW HEADER ANIMATION --- */

.content-area { 
    flex-grow: 1; 
    padding: 1.5rem; 
    overflow-y: auto; 
    background-color: transparent; 
    width: 100%;
    max-width: 960px; 
    margin: 0 auto; 
}

.app-footer-main {
    background-color: var(--bg-color-light-secondary);
    text-align: center;
    padding: 1rem;
    font-size: 0.875rem;
    color: var(--text-color-light-secondary);
    border-top: 1px solid var(--bg-color-light-quaternary);
    flex-shrink: 0; 
    width: 100%;
}

.welcome-screen {
    text-align: center;
    max-width: 700px; 
    margin: 2rem auto; 
    padding: 2rem 1rem; 
    position: relative; 
    border-radius: var(--border-radius-md); 
    background: linear-gradient(125deg, 
        var(--accent-color-soft-blue1), 
        var(--bg-color-light-primary), 
        var(--accent-color-soft-blue2),
        var(--bg-color-light-primary)
    );
    background-size: 300% 300%; 
    animation: animatedGradient 8s ease infinite; 
    color: var(--text-color-light-primary); 
    box-shadow: var(--box-shadow-md);
}

@keyframes animatedGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}


.welcome-screen h2 {
    font-size: 2.5rem; 
    font-weight: 500;
    color: var(--text-color-light-primary); 
    margin-bottom: 0.5rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1); 
}
.welcome-subtitle {
    font-size: 1.1rem;
    color: var(--text-color-light-primary); 
    margin-bottom: 2.5rem;
}

.main-prompt-form .prompt-box-container {
    background-color: rgba(255, 255, 255, 0.9); 
    border-radius: var(--border-radius-md);
    padding: 1.25rem; 
    border: 1px solid var(--bg-color-light-quaternary);
    box-shadow: var(--box-shadow-md);
    margin-bottom: 1.5rem;
}

.file-input-area {
    border: 2px dashed var(--bg-color-light-quaternary);
    border-radius: var(--border-radius-md); 
    padding: 1.5rem; 
    text-align: center;
    cursor: pointer;
    margin-bottom: 1.25rem; 
    transition: border-color 0.2s ease, background-color 0.2s ease;
    background-color: var(--bg-color-light-primary); 
}
.file-input-area.dragover { 
    border-color: var(--accent-color-blue) !important; 
    background-color: #e6ffed; 
}
.file-input-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-color-light-secondary);
    cursor: pointer;
}
.file-input-label .material-icons-outlined {
    font-size: 2.5rem; 
    margin-bottom: 0.5rem;
    color: var(--accent-color-blue); 
}
.file-input-area input[type="file"] {
    display: none; 
}
.file-name-display {
    margin-top: 0.75rem; 
    font-size: 0.85rem; 
    color: var(--text-color-light-secondary);
    min-height: 1.2em; 
}


.controls-row {
    display: flex;
    align-items: center;
    gap: 1rem; 
    margin-top: 1.25rem;
    flex-wrap: wrap;
}
.form-group.inline {
    display: flex;
    align-items: center;
    gap: 0.5rem; 
    flex-grow: 1;
}
.form-group.inline label {
    font-size: 0.85rem; 
    color: var(--text-color-light-secondary);
    white-space: nowrap;
    margin-bottom: 0;
}
.form-group.inline input[type="text"], 
.form-group.inline select {
    background-color: var(--bg-color-light-secondary); 
    border: 1px solid var(--bg-color-light-quaternary);
    color: var(--text-color-light-primary);
    border-radius: var(--border-radius-sm);
    padding: 0.5rem 0.75rem; 
    font-size: 0.85rem;
    flex-grow: 1; 
    min-width: 140px; 
}
.form-group.inline select { 
     background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236c757d' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"); 
    appearance: none;
    background-repeat: no-repeat;
    background-position: right 0.6rem center; 
    background-size: 14px 10px;
}
.form-group.inline input[type="text"]:focus, 
.form-group.inline select:focus {
    border-color: var(--accent-color-blue);
    box-shadow: 0 0 0 0.15rem rgba(13, 110, 253, 0.25); 
}


.btn-run-summary {
    background-color: var(--accent-color-blue);
    color: var(--accent-color-blue-text);
    border: none;
    border-radius: var(--border-radius-md);
    padding: 0.6rem 1.25rem; 
    font-weight: 500;
    font-size: 0.9rem; 
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--box-shadow-sm);
}
.btn-run-summary:hover {
    background-color: var(--accent-color-blue-darker); 
    box-shadow: var(--box-shadow-md);
}
.btn-run-summary:disabled {
    background-color: var(--bg-color-light-tertiary);
    color: var(--text-color-light-disabled);
    cursor: not-allowed;
    box-shadow: none;
}
.btn-run-summary .material-icons-outlined {
    font-size: 1.25rem; 
}

.loader-container {
    text-align: right; 
    height: 20px; 
    margin-top: 0.5rem;
}
.loader {
    border: 3px solid var(--bg-color-light-tertiary); 
    border-top: 3px solid var(--accent-color-blue); 
    border-radius: 50%;
    width: 20px; 
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block; 
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.features-section {
    margin-top: 2.5rem;
    text-align: left;
}
.features-section h3 {
    font-size: 1.25rem; 
    font-weight: 500;
    color: var(--text-color-light-primary); 
    margin-bottom: 1.5rem; 
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); 
    gap: 1.5rem; 
}
.feature-card {
    background-color: rgba(255, 255, 255, 0.85); 
    border-radius: var(--border-radius-md);
    padding: 1.5rem; 
    border: 1px solid rgba(222, 226, 230, 0.7); 
    box-shadow: var(--box-shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--box-shadow-md);
}
.feature-icon {
    font-size: 1.75rem; 
    color: var(--accent-color-blue);
    margin-bottom: 0.75rem;
    display: block;
}
.feature-card h4 {
    font-size: 1rem; 
    font-weight: 500;
    color: var(--text-color-light-primary);
    margin-bottom: 0.5rem;
}
.feature-card p {
    font-size: 0.85rem; 
    color: var(--text-color-light-secondary);
    line-height: 1.5;
}

.results-display-area.hidden {
    display: none;
}

.summary-item {
    background-color: var(--bg-color-light-secondary); 
    border-radius: var(--border-radius-md);
    margin-bottom: 1.25rem;
    border: 1px solid var(--bg-color-light-quaternary);
    padding: 0; 
    box-shadow: var(--box-shadow-sm);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInSlideUp 0.5s ease-out forwards;
}
.summary-item:nth-child(1) { animation-delay: 0.1s; }
.summary-item:nth-child(2) { animation-delay: 0.2s; }
.summary-item:nth-child(3) { animation-delay: 0.3s; }

@keyframes fadeInSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.summary-item.system-message { 
    background-color: var(--bg-color-light-tertiary); 
    animation: none; 
    opacity: 1; transform: translateY(0); 
    padding: 1.25rem; 
}
.summary-item.error { 
     background-color: var(--accent-color-red-bg-light); 
     border-color: var(--accent-color-red);
     padding: 1.25rem;
}

.message-header {
    display: flex;
    align-items: center;
    color: var(--text-color-light-secondary);
    font-weight: 500;
    margin-bottom: 1rem; 
    font-size: 0.9rem;
    padding: 0; 
}
.summary-item.system-message .message-header,
.summary-item.error .message-header {
    padding: 0;
    margin-bottom: 0.75rem;
}

.message-header .material-icons-outlined {
    margin-right: 0.5rem; 
    font-size: 1.1rem;
    color: var(--accent-color-blue);
}
.summary-item.error .message-header .material-icons-outlined {
    color: var(--accent-color-red);
}
.summary-item.error .message-header {
    color: var(--accent-color-red); 
}

.message-subheader {
    font-weight: 500;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.9rem;
    color: var(--text-color-light-secondary);
}
.message-subheader:first-child {
    margin-top: 0;
}
.message-subheader .material-icons-outlined {
    font-size: 1.1rem;
    color: var(--text-color-light-secondary); 
}
.message-subheader .material-icons-outlined[data-icon-type="flag"] {
    color: var(--accent-color-red);
}
.message-subheader .material-icons-outlined[data-icon-type="flag_error"] {
    color: var(--accent-color-red-darker);
}
.message-subheader .material-icons-outlined[data-icon-type="check"] {
    color: var(--accent-color-green-check);
}


.message-content pre {
    font-family: var(--font-family-monospace);
    background-color: var(--bg-color-light-primary); 
    padding: 0.75rem;
    border-radius: var(--border-radius-sm);
    color: var(--text-color-light-primary);
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 0.85rem;
    max-height: 400px; 
    overflow-y: auto;
    border: 1px solid var(--bg-color-light-quaternary);
}
.red-flags-content pre {
    background-color: var(--accent-color-red-bg-light) !important;
    border-left: 3px solid var(--accent-color-red);
    color: var(--accent-color-red-darker) !important;
}
.red-flags-content.error p { 
    color: var(--accent-color-red-darker);
    font-style: italic;
}
.red-flags-content p { 
    color: var(--text-color-light-primary);
    padding: 0.5rem 0;
}


.summary-item.error .message-content p, 
.summary-item.system-message .message-content p {
     color: var(--text-color-light-primary);
}
.summary-item.error .message-content pre,
.summary-item.error .message-content { 
    color: var(--accent-color-red);
    background-color: transparent; 
    border-color: transparent;
}


.message-actions {
    margin-top: 1.25rem; 
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.btn-action {
    background-color: var(--bg-color-light-tertiary);
    color: var(--text-color-light-secondary);
    border: 1px solid var(--bg-color-light-quaternary);
    padding: 0.4rem 0.8rem; 
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: var(--border-radius-sm);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}
.btn-action:hover {
    background-color: #ced4da; 
    color: var(--text-color-light-primary);
    border-color: #adb5bd;
}
.btn-action .material-icons-outlined {
    font-size: 1rem; 
}

.resummarize-form {
    display: flex; 
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.resummarize-form select {
    background-color: var(--bg-color-light-secondary);
    border: 1px solid var(--bg-color-light-quaternary);
    color: var(--text-color-light-primary);
    border-radius: var(--border-radius-sm);
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236c757d' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    appearance: none;
    background-repeat: no-repeat;
    background-position: right 0.4rem center;
    background-size: 12px 8px;
    flex-grow: 1; 
    min-width: 120px; 
}
.resummarize-form select:focus {
    border-color: var(--accent-color-blue);
    box-shadow: 0 0 0 0.15rem rgba(13, 110, 253, 0.25);
}
.resummarize-form button.regenerate-button { 
    padding: 0.4rem 0.8rem; 
}


/* Audio Player Styles */
.audio-player-container {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--bg-color-light-tertiary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.audio-player-container .audio-label {
    font-size: 0.85rem;
    color: var(--text-color-light-secondary);
    font-weight: 500;
}
.audio-player-container audio {
    height: 40px; 
    max-width: 280px; 
    border-radius: var(--border-radius-sm);
    outline: none;
}
.audio-player-container .audio-download-btn {
    margin-left: auto; 
}


/* Chat Interface Styles */
.chat-with-doc-container {
    margin-top: 0; 
    padding: 0;
    border: none;
    background-color: transparent;
}
.chat-with-doc-container h4 {
    display: none; 
}
.chat-messages {
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--bg-color-light-tertiary);
    border-radius: var(--border-radius-sm);
    background-color: var(--bg-color-light-primary);
    font-size: 0.9rem;
}
.chat-message {
    margin-bottom: 0.75rem;
    padding: 0.6rem 0.9rem;
    border-radius: var(--border-radius-md);
    line-height: 1.4;
    word-wrap: break-word;
}
.chat-message:last-child {
    margin-bottom: 0;
}
.chat-message p { margin: 0; }
.chat-message .chat-actor { font-weight: 500; }

.chat-message.user {
    background-color: var(--accent-color-soft-blue1); 
    margin-left: auto;
    max-width: 80%;
}
.chat-message.user .chat-actor { color: var(--accent-color-blue-darker); }

.chat-message.assistant {
    background-color: #f0f0f0; 
    margin-right: auto;
    max-width: 80%;
}
.chat-message.assistant .chat-actor { color: var(--text-color-light-secondary); }

.chat-message.assistant.thinking p,
.chat-message.assistant.error p {
    font-style: italic;
    color: var(--text-color-light-disabled);
}
.chat-message.assistant.error p {
    color: var(--accent-color-red);
}

.chat-input-area {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.chat-input {
    flex-grow: 1;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--bg-color-light-quaternary);
    border-radius: var(--border-radius-sm);
    font-size: 0.9rem;
}
.chat-input:focus {
    border-color: var(--accent-color-blue);
    box-shadow: 0 0 0 0.15rem rgba(13, 110, 253, 0.25);
    outline: none;
}
.chat-send-btn, .transcribe-btn { 
    padding: 0.5rem 0.75rem !important; 
    flex-shrink: 0;
}
.transcribe-btn .material-icons-outlined {
    font-size: 1.1rem;
}
.transcription-status {
    font-size: 0.75rem;
    color: var(--text-color-light-secondary);
    margin-top: 0.3rem;
    min-height: 1.1em;
    text-align: left;
}


/* New Prompt Area (after results) */
.new-prompt-area {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--bg-color-light-quaternary);
}
.new-prompt-title {
    font-size: 1rem; 
    font-weight: 500;
    color: var(--text-color-light-secondary);
    margin-bottom: 1rem;
}
#followUpSummaryForm .prompt-box-container {
    padding: 1rem; 
    background-color: var(--bg-color-light-secondary);
}
#followUpSummaryForm .file-input-area {
    padding: 1.25rem; 
    margin-bottom: 1rem;
}
#followUpSummaryForm .file-input-label span:not(.material-icons-outlined) {
    font-size: 0.9rem;
}

/* --- NEW ATTRACTIVE TAB STYLES --- */
.tab-nav {
    display: flex;
    border-bottom: 1px solid var(--bg-color-light-quaternary);
    padding: 0 0.75rem;
}

.tab-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    border: 1px solid transparent;
    border-bottom: 1px solid var(--bg-color-light-quaternary);
    border-radius: 8px 8px 0 0;
    background-color: transparent;
    color: var(--text-color-light-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    position: relative;
    top: 1px;
    transition: background-color 0.25s ease-in-out, color 0.25s ease-in-out, border-color 0.25s ease-in-out, transform 0.25s ease-in-out;
}

.tab-link:hover:not(.active) {
    background-color: var(--bg-color-light-tertiary);
    color: var(--text-color-light-primary);
    transform: translateY(-2px);
}

.tab-link.active {
    background-color: var(--bg-color-light-secondary);
    color: var(--accent-color-blue);
    border-color: var(--bg-color-light-quaternary);
    border-bottom-color: var(--bg-color-light-secondary); /* This makes it look connected */
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.04);
}

.tab-link .material-icons-outlined {
    font-size: 1.1rem;
}

.tab-content {
    display: none;
    padding: 1.25rem;
    border-top: 1px solid transparent; /* Ensures consistent layout */
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.tab-footer-actions {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--bg-color-light-tertiary);
}



/* --- END TAB STYLES --- */

/* Responsive */
@media (max-width: 768px) {
    .main-header {
        padding: 0 1rem;
    }
    .main-title { font-size: 1.1rem; } 
    
    @keyframes animateThunderbolt {
        0%, 41% {
            transform: translate(calc(50vw - 1rem), 10px) scale(0);
            opacity: 0;
        }
        43% {
            transform: translate(calc(50vw - 1rem), 10px) scale(2);
            opacity: 1;
        }
        70% {
            transform: translate(10px, 18px) scale(0);
            opacity: 0;
        }
        100% { opacity: 0; }
    }

    .content-area {
        padding: 1rem;
    }
    .welcome-screen { 
        margin: 0.5rem auto 1.5rem auto; 
        padding: 1.5rem 0.5rem; 
    }
    .welcome-screen h2 { font-size: 1.8rem; } 
    .welcome-subtitle { font-size: 0.95rem; margin-bottom: 1.5rem; } 
    
    .main-prompt-form .prompt-box-container { padding: 0.75rem; }
    .file-input-area { padding: 1rem; }
    .file-input-label .material-icons-outlined { font-size: 2rem; } 

    .controls-row {
        flex-direction: column;
        align-items: stretch; 
        gap: 0.75rem;
    }
    .form-group.inline {
        width: 100%; 
        gap: 0.4rem;
    }
    .form-group.inline input[type="text"],
    .form-group.inline select {
        flex-grow: 1;
    }
    .btn-run-summary {
        width: 100%; 
        justify-content: center;
        margin-top: 0.5rem;
        padding: 0.5rem 1rem;
    }
    .features-grid {
        grid-template-columns: 1fr; 
    }
    .message-actions {
        flex-direction: column;
        align-items: stretch; 
    }
    .btn-action {
        width: 100%;
        justify-content: center; 
        margin-bottom: 0.4rem;
    }
    .resummarize-form {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }
    .resummarize-form select, .resummarize-form button.btn-action {
        width: 100%;
        margin-top: 0.4rem;
    }
    .resummarize-form select { margin-right: 0; } 

    .audio-player-container {
        flex-direction: column;
        align-items: flex-start;
    }
    .audio-player-container .audio-download-btn {
        margin-left: 0;
        width: 100%; 
    }
    .audio-player-container audio {
        max-width: 100%;
        width: 100%;
    }

    .chat-message.user, .chat-message.assistant {
        max-width: 95%;
    }

    .tab-nav {
        padding: 0 0.5rem;
        flex-wrap: wrap; 
    }
    .tab-link {
        padding: 0.6rem 0.8rem;
        font-size: 0.8rem;
    }
    .tab-content {
        padding: 0.75rem;
    }

    .chat-input-area .btn-action {
        width: auto; /* Reset width to be automatic, not 100% */
        margin-bottom: 0; /* Remove the extra margin */
    }
}
