:root {
    --primary-gradient: linear-gradient(90deg, #4F46E5, #818CF8);
    --primary-color: #4F46E5;
    --primary-color-dark: #4338CA;
    --primary-color-light: rgba(79, 70, 229, 0.2);
    --danger-color: #DC2626;
    --danger-color-dark: #B91C1C;
    --background-color: #F8FAFC;
    --background-color-light: #FFFFFF;
    --text-color: #334155;
    --text-color-primary: #1E293B;
    --text-color-secondary: #64748B;
    --container-bg: #FFFFFF;
    --border-color: #E2E8F0;
    --agent-bg: #F1F5F9;
    --agent-active-bg: #4F46E5;
    --arrow-color: #94A3B8;
    --arrow-active-color: #4F46E5;
}

@media (max-width: 500px) {
    .videos-grid {
        grid-template-columns: 1fr;
    }
}

body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

html,body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100%;
    margin: 0;
    padding: 0;
}
header {
    width: 100%;
    background-color: var(--background-color-light, #ffffff);
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    max-width: 1400px;
    margin: 0 auto;
}
/* style.css */
.app-header {
    /*width: 100%;*/
    width: 100vw;
        /* 👈 force full viewport width */
    background-color: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.header-content {
    max-width: 1400px !important;
    margin: 0 auto;
    height: 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-link:hover {
    color: var(--primary-color);
    /* if you're using CSS vars */
}

.main-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    background-color: var(--container-bg);
    padding: 50px;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    max-width: 1100px;
    width: 90%;
    align-items: center;
}

.content-column {
    text-align: left;
}

.header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    grid-column: 1 / -1;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-link {
    text-decoration: none;
    color: #64748B;
    font-weight: 500;
    transition: color 0.3s;
    line-height: 1;
}

.nav-link:hover {
    color: var(--agent-active-bg);
}

/* Call-to-action button style for navigation */
.button-cta {
    background-color: #4A5568;
    /* A neutral, dark gray */
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
}

.button-cta:hover {
    background-color: #2D3748;
    /* Darker gray on hover */
    color: white;
    /* Ensure text remains white on hover */
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-icon {
    height: 60px;
    width: auto;
}

img.logo-text {
    height: 40px;
    width: auto;
    margin-top: 4px;
    /* Optical alignment */
}

.logo-text {
    font-size: 2.5rem;
    font-weight: 800;
    color: #334155;
    line-height: 1;
}

h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}

p {
    color: #64748B;
    margin-bottom: 30px;
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 80%;
}

input[type="url"] {
    width: calc(100% - 24px);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    font-size: 16px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input[type="url"]:focus {
    border-color: #4F46E5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
    outline: none;
}

button {
    background: var(--primary-gradient);
    color: white;
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    transition: all 0.3s;
}

button:hover {
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
    transform: translateY(-2px);
}

button.loading {
    position: relative;
    cursor: wait;
}

.button-text {
    transition: visibility 0s linear 0s;
}

button.loading .button-text {
    visibility: hidden;
}

button.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-top: -10px;
    margin-left: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.7);
    }

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

    100% {
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0);
    }
}

#status {
    margin-top: 25px;
    font-weight: 500;
    font-size: 1rem;
    min-height: 20px;
}

.status-success {
    color: #16A34A;
}

.status-error {
    color: #DC2626;
}

.workflow-column h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 20px;
    text-align: center;
}

.workflow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.agent,
.arrow {
    padding: 10px 15px;
    border-radius: 8px;
    background-color: var(--agent-bg);
    color: #64748B;
    transition: all 0.4s ease;
    opacity: 0.6;
    font-weight: 500;
}

.arrow {
    font-size: 1.2rem;
    background: none;
    padding: 0;
    color: var(--arrow-color);
    transform: rotate(90deg);
}

.agent.active {
    background: var(--agent-active-bg);
    color: white;
    transform: scale(1.05);
    opacity: 1;
    animation: pulse 2s infinite;
}

.agent.active::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.arrow.active {
    color: var(--arrow-active-color);
    transform: scale(1.2) rotate(90deg);
    opacity: 1;
}

.agent.success {
    background-color: #16A34A;
    /* Green */
    color: white;
    opacity: 1;
}

.agent.failed {
    background-color: #DC2626;
    /* Red */
    color: white;
    opacity: 1;
}

.agent::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 8px;
    background-size: contain;
    background-repeat: no-repeat;
    vertical-align: middle;
}

.agent.success::after {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>');
}

.agent.failed::after {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>');
}

.agent.clickable {
    cursor: pointer;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.agent.clickable:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Styles for the focused results view */
.results-view {
    grid-template-columns: 1fr !important;
    max-width: 900px;
}

.results-view .workflow-column,
.results-view .content-column p,
.results-view .content-column #ingestForm {
    display: none;
}

.results-view .content-column {
    text-align: center;
}

.results-view .results-container {
    text-align: left;
}

/* Dashboard-specific styles */
.dashboard {
    width: 100%;
}

.dashboard-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.dashboard-header img {
    width: 160px;
    /* 16:9 aspect ratio */
    height: 90px;
    border-radius: 8px;
    object-fit: cover;
}

.dashboard-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

.image-gallery-container {
    margin-bottom: 30px;
}

.image-gallery-container h4 {
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.image-gallery {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.image-gallery a {
    display: block;
}

.image-gallery img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

.image-gallery img:hover {
    border-color: var(--agent-active-bg);
}

.diversity-options {
    margin-bottom: 30px;
}

.diversity-options h4 {
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.diversity-options .options-grid {
    display: flex;
    gap: 20px;
    background-color: var(--agent-bg);
    padding: 20px;
    border-radius: 8px;
}

.diversity-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.content-card {
    background-color: var(--container-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

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

.content-card-header h4 {
    margin: 0;
    font-size: 1.1rem;
}

.content-card-header button {
    margin-left: auto;
    /* Pushes the button to the right */
}

.content-card-body {
    padding: 20px;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-color);
    white-space: pre-wrap;
    outline: none;
    /* For contenteditable */
}

.content-card-body:focus {
    box-shadow: inset 0 0 0 2px var(--agent-active-bg);
}

.copy-button {
    background: var(--agent-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
}

.regenerate-button {
    background: var(--agent-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    margin-left: 15px;
}

.regenerate-button.loading {
    position: relative;
    cursor: wait;
}

.regenerate-button.loading .button-text {
    visibility: hidden;
}

.regenerate-button.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-top: -8px;
    margin-left: -8px;
    border: 2px solid var(--text-color);
    border-top-color: var(--agent-bg);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

#back-to-workflow {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--agent-bg);
    color: var(--text-color);
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    display: none;
    /* Hidden by default */
}

.results-view #back-to-workflow {
    display: block;
    /* Visible only in results view */
}

@media (max-width: 900px) {
    .main-container {
        grid-template-columns: 1fr;
        padding: 30px;
        width: 95%;
    }

    h1 {
        font-size: 2.5rem;
    }

    .content-column {
        text-align: center;
    }

    p {
        margin-left: auto;
        margin-right: auto;
    }
}

.results-container {
    margin-top: 40px;
    text-align: left;
    border-top: 1px solid var(--border-color);
    padding-top: 30px;
}

.results-container h3 {
    font-size: 1.2rem;
    color: var(--text-color);
    margin-bottom: 15px;
}

.results-container p {
    background-color: var(--agent-bg);
    padding: 15px;
    border-radius: 8px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 0.95rem;
}

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

.results-container li {
    background-color: var(--agent-bg);
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-style: italic;
}

.results-container .image-gallery img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 10px;
    border: 1px solid var(--border-color);
}

.content-card-body ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.content-card-body li {
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
    border: 1px solid var(--border-color);
}

.content-card-body li:hover {
    background-color: var(--agent-bg);
}

.content-card-body li.generating {
    cursor: wait;
    background-color: var(--agent-bg);
    color: var(--text-color);
    position: relative;
}

.content-card-body li.generating::after {
    content: '';
    position: absolute;
    right: 15px;
    top: 50%;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    border: 2px solid var(--text-color);
    border-top-color: var(--agent-bg);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* --- Management Page Styles --- */
.management-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
    width: 90%;
}

.management-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #e2e8f0;
}

.management-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.management-header p {
    font-size: 1.1rem;
    color: #64748B;
    max-width: 600px;
    margin: 0 auto 20px;
}

.button-link {
    display: inline-block;
    text-decoration: none;
    background: var(--primary-gradient);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 700;
    transition: all 0.3s;
}

.button-link:hover {
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
    transform: translateY(-2px);
}

.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.video-card {
    background-color: var(--container-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
    transition: all 0.3s ease;
    cursor: pointer;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

#video-status-banner {
    padding: 6px 14px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
    flex-shrink: 0;
    margin-right: 15px;
    /* Adds space between banner and nav link */
}

.card-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    /* 16:9 Aspect Ratio */
    background-color: #f0f0f0;
}

.card-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-status {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
}

.card-content {
    padding: 20px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    line-height: 1.4;

    /* Truncation properties */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    /* Limit to 2 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 3.0em;
    /* (line-height * line-clamp) */
}

.card-hook {
    font-size: 0.9rem;
    color: #64748B;
    line-height: 1.5;
    margin: 0;

    /* Truncation properties */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    /* Limit to 3 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 4.5em;
    /* (line-height * line-clamp) */
}

.card-footer {
    display: flex;
    flex-direction: column;
    /* Stack images and meta info */
    gap: 10px;
    padding: 15px;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    /* Pushes footer to the bottom */
}

.footer-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.processed-date {
    font-size: 0.8rem;
    color: #64748B;
    font-style: italic;
}

.footer-images {
    display: flex;
    gap: 5px;
}

.footer-thumbnail {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
}

.no-images {
    font-size: 0.8rem;
    color: #94A3B8;
}

.reprocess-button {
    background: #F1F5F9;
    color: #64748B;
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.reprocess-button:hover {
    background: #E2E8F0;
    color: var(--text-color);
    border-color: #CBD5E1;
}

.reprocess-button:disabled {
    background: #F8FAFC;
    cursor: wait;
    opacity: 0.7;
}

/* --- Shorts Suggestions Styles --- */
.shorts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.short-candidate-card {
    background-color: #F8FAFC;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
}

.short-candidate-card h5 {
    font-size: 1.1rem;
    margin: 0 0 10px 0;
}

.short-candidate-card .reason {
    font-size: 0.9rem;
    color: #64748B;
    margin: 0 0 15px 0;
}

.short-candidate-card .snippet {
    font-size: 0.9rem;
    font-style: italic;
    color: var(--text-color);
    margin: 0 0 20px 0;
    padding-left: 15px;
    border-left: 3px solid #CBD5E1;
}

.button-link-small {
    display: inline-block;
    text-decoration: none;
    background: var(--primary-gradient);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s;
}

.button-link-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.2);
}

/* Status Colors */
.status-success {
    background-color: #16A34A;
}

.status-failed {
    background-color: #DC2626;
}

.status-in-progress {
    background-color: #64748B;
}

.status-unknown {
    background-color: #94A3B8;
}

/* --- Modal Styles --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #94A3B8;
}
.modal-download-button {
    position: absolute;
    top: 15px;
    left: 15px;
}

.modal-content-image {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
}

.modal-image-wrapper {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: inline-block;
}

.modal-image-quote {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1rem;
    color: #fff;
    text-align: center;
    font-size: clamp(1rem, 2.5vw, 2rem);
    font-style: italic;
    font-weight: bold;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
    background-color: rgba(0, 0, 0, 0.6);
}

/* --- Detail Page Styles --- */
.detail-container {
    width: 90%;
    max-width: 1200px;
    margin: 40px auto;
}

.detail-header {
    display: block;
    /* Changed from flex */
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    /* Space between top row and title */
}

.header-top-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.detail-header .header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.detail-header h1 {
    font-size: 2.2rem;
    /* Increased size */
    margin: 0;
    text-align: left;
    /* Changed from center */
    flex-grow: 0;
    /* Removed grow */
    background: none;
    -webkit-text-fill-color: initial;
    /* This and next line are a reset */
    text-fill-color: initial;
    color: var(--text-color);
    /* Added solid color */
    font-weight: 700;
    /* Added font-weight */
}

.loader {
    border: 5px solid #f3f3f3;
    /* Light grey */
    border-bottom-color: transparent;
    border-radius: 50%;
    display: block;
    margin: 50px auto;
    box-sizing: border-box;
    animation: spin 1s linear infinite;
}

.status-link {
    color: var(--agent-active-bg);
    font-weight: 700;
    text-decoration: none;
}

.progress-bar-container {
    width: 100%;
    background-color: var(--border-color);
    border-radius: 8px;
    margin-top: 15px;
    height: 10px;
    display: none;
    /* Hidden by default */
}

.progress-bar {
    width: 0;
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 8px;
    animation: indeterminate-progress 2.5s ease-in-out infinite;
}

@keyframes indeterminate-progress {
    0% {
        width: 0%;
        margin-left: 0%;
    }

    50% {
        width: 100%;
        margin-left: 0%;
    }

    100% {
        width: 0%;
        margin-left: 100%;
    }
}

#shorts-candidates-container ul {
    list-style-type: none;
    padding: 0;
}

#shorts-candidates-container li {
    background-color: #2e2e33;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #a855f7;
}

#shorts-candidates-container h4 {
    margin-top: 0;
    color: #f0f0f0;
}

#shorts-candidates-container p {
    margin-bottom: 10px;
}

#shorts-candidates-container a {
    color: #a855f7;
    text-decoration: none;
    font-weight: bold;
}

#shorts-candidates-container a:hover {
    text-decoration: underline;
}

/* Quote Card Styles */
#quotes-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.quote-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    padding: 0;
    background: transparent;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Quote visuals now have text baked into the image; remove old readability overlays. */
.quote-card::before {
    content: none;
}

/* Tab Navigation Styles */
.tab-nav {
    display: flex;
    border-bottom: 2px solid #3a3a40;
    margin-bottom: 20px;
}

.tab-link {
    background: none;
    border: none;
    color: #a0a0a0;
    padding: 12px 20px;
    font-size: 1.1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    /* Align with the container's bottom border */
}

.tab-link:hover {
    color: #ffffff;
    background-color: #a855f7;
}

.tab-link.active {
    color: #ffffff;
    background-color: #a855f7;
    border-bottom-color: #c084fc;
    /* Lighter purple to make the active border pop */
}

.tab-content {
    display: none;
    /* Hide all tabs by default */
}

.tab-content.active {
    display: block;
    /* Show only the active tab */
}

/* Layout for Overview Tab */
.overview-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
}

/* Generated Thumbnails Grid - Changed to Flexbox */
.thumbnails-grid {
    display: flex;
    flex-direction: row;
    /* Changed to row */
    flex-wrap: wrap;
    /* Allow items to wrap to the next line */
    gap: 20px;
}

.thumbnail-item {
    display: block;
    gap: 15px;
    
    padding: 15px;
    border-radius: 8px;
    
    /* Adjust width for two columns with gap */
    align-items: flex-start;
    /* Align items to the top */
    box-sizing: border-box;
    /* Ensure padding and border are included in the width */
}

.thumbnail-image-wrapper {
    flex-shrink: 0;
}

.thumbnail-image-wrapper a {
    display: block;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease-in-out;
}

.thumbnail-image-wrapper a:hover {
    transform: scale(1.05);
}

.thumbnail-image-wrapper img {
    width: 200px;
    /* Increased width */
    height: auto;
    /* Maintain 16:9 aspect ratio */
    object-fit: fit;
    display: block;
    cursor: pointer;
}

.thumbnail-prompt {
    flex-grow: 1;
    color: #f3efef;
}

.thumbnail-prompt h4 {
    margin: 0 0 5px 0;
    color: #ffffff;
    font-size: 0.9em;
    font-weight: 500;
}

.thumbnail-prompt p {
    margin: 0;
    font-size: 0.95em;
    color: #ffffff;
    line-height: 1.5;
    white-space: normal;
    /* Allow text to wrap */
    margin-bottom: 10px;
    /* Add space above the button */
}

/* On-Demand Generation Section */
.on-demand-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

#new-prompts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#new-prompts-list li {
    background-color: #2e2e33;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    border-left: 3px solid #4f4f52;
}

#new-prompts-list .prompt-text {
    flex-grow: 1;
    margin-right: 10px;
}

.auth-button {
    background: transparent;
    border: 1px solid #4F46E5;
    color: #4F46E5;
    padding: 8px 16px;
}

.auth-button:hover {
    background: rgba(79, 70, 229, 0.1);
    box-shadow: none;
    transform: none;
}

.button-secondary {
    background: none;
    border: 1px solid #CBD5E1;
    color: #4F46E5;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 0.9em;
}

.button-secondary:hover {
    background-color: rgba(79, 70, 229, 0.1);
}

.inline-loader {
    width: 24px;
    height: 24px;
    border: 3px solid #4A5568;
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

/* Hamburger Menu Styles */
.hamburger-menu {
    display: none;
    /* Hidden by default on desktop */
    flex-direction: column;
    justify-content: space-around;
    width: 2rem;
    height: 2rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
}

.hamburger-line {
    width: 2rem;
    height: 0.25rem;
    background: #334155;
    border-radius: 10px;
    transition: all 0.3s linear;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        /* Hide nav links by default on mobile */
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 20px;
        background-color: white;
        position: absolute;
        top: 100%;
        right: 0;
        width: 100%;
        padding: 20px;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
        border-radius: 0 0 10px 10px;
    }

    .nav-links.active {
        display: flex;
    }

    .hamburger-menu {
        display: flex;
        /* Show hamburger on mobile */
    }
}

.video-meta-item {
    font-size: 0.9rem;
    color: #64748B;
    /* A neutral, softer text color */
    background-color: #F1F5F9;
    /* A very light gray, similar to agent-bg */
    padding: 6px 14px;
    border-radius: 8px;
    white-space: nowrap;
}

.detail-header .header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* --- Social Preview Modal Styles --- */
.social-preview-popup {
    width: 500px !important;
}

.social-preview-caption {
    text-align: left;
    margin-top: 15px;
    font-size: 1em;
    line-height: 1.5;
    white-space: pre-wrap;
    background-color: #f3f4f6;
    padding: 15px;
    border-radius: 8px;
    color: #374151;
}

/* --- Shorts Candidate Styles --- */
.shorts-list {
    list-style: none;
    padding: 0;
}

.short-candidate-item {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 20px;
    background-color: #2e2e33;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #a855f7;
}

.short-info {
    flex-grow: 1;
}

.short-info h4 {
    margin: 0 0 10px 0;
    color: #f0f0f0;
}

.short-info p {
    margin: 0 0 10px 0;
    color: #c0c0c0;
    font-size: 0.95em;
}

.short-info .snippet {
    font-style: italic;
    color: #d0d0d0;
    border-left: 3px solid #4a4a52;
    padding-left: 10px;
}

.timestamp-info {
    font-size: 0.85em;
    color: #a0a0a0;
    font-weight: 500;
}

.short-actions {
    flex-basis: 200px;
    /* Give the actions column a fixed base width */
    flex-shrink: 0;
    text-align: center;
}

.clip-preview-container video {
    width: 180px;
    aspect-ratio: 9/16;
    object-fit: cover;
    border-radius: 8px;
    margin-top: 10px;
}

.clip-buttons {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-top: 10px;
}

.button-danger {
    background-color: #DC2626;
    /* Red */
    color: white;
    padding: 6px 12px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 0.9em;
}

.button-danger:hover {
    background-color: #B91C1C;
    /* Darker Red */
}

.short-loader {
    margin: 20px auto;
}