body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f4f7f9;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

#main-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    min-height: 100vh;
}

.container {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 800px; /* Wider for canvas */
    text-align: center;
}

h1 { font-size: 2rem; color: #2c3e50; margin-bottom: 10px; }
p { font-size: 1.1rem; color: #7f8c8d; margin-bottom: 30px; }

#initiate-form, #zone-editor-container, #progress-container, #final-output-container {
    text-align: left;
}

/* General Form Styling */
.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #4a5568;
}

input[type="text"],
input[type="file"],
input[type="email"], /* Added for email input styling */
select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #cbd5e0;
    border-radius: 0.375rem;
    box-sizing: border-box; /* Important for consistent sizing */
    transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="file"]:focus,
input[type="email"]:focus, /* Added for email input styling */
select:focus {
    border-color: #4299e1;
    outline: none;
}

.button-group {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
}

.tab-container {
    width: 100%;
    display: flex;
    flex-direction: column;
}
.tab-button {
    padding: 10px 20px; cursor: pointer; border: none; background-color: transparent;
    font-size: 1rem; font-weight: 500; color: #7f8c8d; transition: all 0.3s ease;
    border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.tab-button.active, .tab-button:hover { color: #3498db; border-bottom-color: #3498db; }
.tab-content { padding: 10px 0; }

.button {
    background-color: #3498db; color: white; padding: 14px 25px; border: none;
    border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer;
    transition: background-color 0.3s ease; width: 100%;
}
.button:hover { background-color: #2980b9; }

/* Disabled button state */
.button:disabled,
.button[disabled] {
    background-color: #b0bec5;
    color: #f0f3f5;
    cursor: not-allowed;
    opacity: 0.7;
    box-shadow: none;
}

.button.disabled, .button:disabled {
    background-color: #cccccc;
    color: #666666;
    cursor: not-allowed;
    pointer-events: none;
}

.button-secondary {
    display: inline-block;
    text-decoration: none;
    background-color: #eaf5ff;
    color: #2980b9;
    padding: 10px 15px;
    border: 1px solid #aed6f1;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.button-secondary:hover {
    background-color: #3498db;
    color: white;
}

.button-secondary.disabled, .button-secondary:disabled {
    background-color: #f0f0f0;
    color: #999999;
    border-color: #dddddd;
    cursor: not-allowed;
    pointer-events: none;
}

#zone-editor-container { margin-top: 20px; }
.zone-instructions { margin-bottom: 15px; padding: 15px; background-color: #f8f9fa; border-radius: 8px; border: 1px solid #e9ecef; }
.zone-controls { display: flex; justify-content: center; align-items: center; gap: 15px; margin-top: 10px; }
#zone-canvas { border: 2px dashed #dfe6e9; border-radius: 8px; cursor: crosshair; max-width: 100%; display: block; margin: 0 auto; }

.zone-notification {
    background-color: #eaf5ff;
    color: #2980b9;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #aed6f1;
    margin-bottom: 15px;
    font-size: 0.9em;
    font-weight: 500;
}

.checkbox-group { display: flex; align-items: center; justify-content: center; margin-top: 15px; margin-bottom: 20px; }
.checkbox-group input[type="checkbox"] { margin-right: 10px; width: auto; }
.checkbox-group label { margin: 0; font-weight: 500; }

#progress-container { margin-top: 20px; }
.progress-bar-container { 
    width: 100%; 
    background-color: #e0e0e0; 
    border-radius: 8px; 
    overflow: hidden; 
    margin: 20px 0;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}
.progress-bar {
    width: 0%;
    height: 25px;
    background: linear-gradient(45deg, #3498db, #2980b9);
    transition: width 0.4s ease;
    text-align: center;
    line-height: 25px;
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.2);
    position: relative;
}
/* Hide in-bar percentage label (was showing just '%') */
.progress-bar::after { content: none; }
#upload-progress-text {
    font-size: 0.9em;
    font-weight: bold;
}

#status-container { 
    display: flex; 
    flex-direction: column;
    align-items: center; 
    justify-content: center; 
    gap: 15px;
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}
#status-text {
    font-size: 1.2em;
    font-weight: 500;
    color: #2c3e50;
    text-align: center;
    margin: 10px 0;
}
.spinner { 
    border: 4px solid rgba(0, 0, 0, 0.1); 
    width: 40px; 
    height: 40px; 
    border-radius: 50%; 
    border-left-color: #3498db; 
    animation: spin 1s ease infinite; 
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.status-line {
    margin: 4px 0;
    padding: 4px 6px;
    border-radius: 4px;
    background: rgba(46, 204, 113, 0.08);
    display: flex;
    align-items: center;
    gap: 8px;
}
.timestamp {
    color: #7f8c8d;
    font-size: 0.9em;
}
.status-label {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: bold;
}
.status-detected {
    background-color: #1e8449; /* darker green for better contrast */
    color: #ffffff;
}

#results-container { margin-top: 20px; text-align: left; }

.terminal-style {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 15px;
    border-radius: 5px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: "Courier New", Courier, monospace;
}

.feedback-container {
    margin-top: 15px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
}

/* Accordion Styles */
.accordion-item {
    margin-bottom: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.accordion-header {
    background-color: #f2f2f2;
    color: #333;
    cursor: pointer;
    padding: 15px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 1.1rem;
    transition: background-color 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.accordion-header:hover {
    background-color: #e0e0e0;
}

.accordion-header.active {
    background-color: #3498db;
    color: white;
}

.accordion-header:after {
    content: '\002B'; /* Plus sign */
    font-weight: bold;
    float: right;
    margin-left: 5px;
}

.accordion-header.active:after {
    content: "\2212"; /* Minus sign */
}

.accordion-panel {
    padding: 0 15px;
    background-color: white;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease-out;
}

.accordion-panel.active {
    max-height: 400px; /* Adjust as needed */
    overflow-y: auto;
}

/* Ensure tables within accordion panels have proper styling */
.accordion-panel .results-table {
    display: block; /* Override display: none from .results-table */
    box-shadow: none; /* Remove extra shadow */
    margin-bottom: 0; /* Remove extra margin */
    border: none; /* Remove extra border */
}

.accordion-panel table {
    margin-top: 15px;
    margin-bottom: 15px;
}

#terminal-output {
    background-color: #2b2b2b;
    color: #f1f1f1;
    font-family: 'Courier New', Courier, monospace;
    padding: 15px;
    border-radius: 5px;
    height: 200px;
    overflow-y: scroll;
    border: 1px solid #555;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.hidden {
    display: none !important;
}

/* Evaluation Results Table Styles */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.metric-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.metric-value {
    font-size: 2em;
    font-weight: bold;
    margin-bottom: 5px;
}

.metric-label {
    font-size: 0.9em;
    opacity: 0.9;
}

.table-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.table-tab {
    background: #ecf0f1;
    border: 2px solid #bdc3c7;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.table-tab:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.table-tab.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.results-table {
    display: none;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.results-table.active {
    display: block;
}

.results-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.results-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 10px;
    text-align: left;
    font-weight: 600;
}

.results-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #ecf0f1;
}

.results-table tr:hover {
    background-color: #f8f9fa;
}

.results-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

/* Modern black/white table for final results */
.modern-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    margin: 20px 0;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}
.modern-table thead th {
	background: #111;
	color: #fff;
	padding: 12px;
	text-align: left;
	font-weight: 600;
	border: none;
}
.modern-table tbody tr {
	background: #fff;
	box-shadow: 0 1px 6px rgba(0,0,0,0.08);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.modern-table tbody tr:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.modern-table th,
.modern-table td {
	padding: 15px 20px;
	vertical-align: middle;
}

/* Modern buttons */
.btn {
	display: inline-block;
	padding: 10px 14px;
	border-radius: 8px;
	text-decoration: none;
	font-weight: 600;
	transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.btn-dark {
	background: #111;
	color: #fff;
}
.btn-dark:hover {
	background: #000;
	color: #fff;
	box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Thumbnails */
.clip-thumb {
	width: 80px;
	height: auto;
	border-radius: 6px;
	cursor: zoom-in;
}

/* --- Unified Modal Styles --- */

/* Common styles for the modal overlay on both index.html and email_sender.html */
.image-modal,
.email-thumbnail-modal {
	position: fixed;
	top: 0; left: 0; right: 0; bottom: 0;
	background: rgba(0,0,0,0.8);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 2000;
}

/* Common styles for the modal image content */
.image-modal img,
.email-thumbnail-modal .modal-content {
	max-width: 90vw;
	max-height: 90vh;
	border-radius: 8px;
    object-fit: contain;
	box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}

/* Specific close button style for index.html */
.image-modal .modal-close {
	position: absolute;
	top: 20px;
	right: 20px;
	background: #111;
	color: #fff;
	border-radius: 999px;
	padding: 8px 12px;
	cursor: pointer;
}

/* Specific close button style for email_sender.html */
.email-thumbnail-modal .close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.email-thumbnail-modal .close:hover,
.email-thumbnail-modal .close:focus {
    color: #bbb;
    text-decoration: none;
}

.match-score {
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 0.9em;
}

.match-score.exact {
    background-color: #27ae60;
    color: white;
}

.match-score.fuzzy {
    background-color: #f39c12;
    color: white;
}

.match-score.low {
    background-color: #e74c3c;
    color: white;
}

.time-info {
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #7f8c8d;
}

.student-name {
    font-weight: 600;
    color: #27ae60;
}

.empty-table {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
    font-style: italic;
} 

/* New Styles for Frame Selection */
#frame-selection-container {
    margin-top: 20px;
    text-align: center; /* Center text content */
}

.frame-gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 15px; /* Spacing between thumbnails */
    margin-top: 20px;
    padding: 10px;
    border: 1px dashed #dfe6e9;
    border-radius: 8px;
    min-height: 200px; /* Ensure visibility even when empty */
}

#frame-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    height: 100%; /* Take full height of gallery when active */
    width: 100%; /* Take full width of gallery when active */
}

.frame-thumbnail {
    width: 150px; /* Fixed width for thumbnails */
    height: 100px; /* Fixed height for thumbnails */
    object-fit: contain; /* Ensure entire image is visible */
    border: 2px solid #3498db;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.frame-thumbnail:hover {
    transform: scale(1.05);
    border-color: #2980b9;
} 

/* Toast Notification Styles */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast-message {
    background-color: #333;
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    animation: fadein 0.5s forwards, fadeout 0.5s forwards 2.5s;
    pointer-events: none;
}

.toast-message.visible {
    visibility: visible;
    pointer-events: auto;
}

@keyframes fadein {
    from { top: 0; opacity: 0; }
    to { top: 20px; opacity: 1; }
}

@keyframes fadeout {
    from { top: 20px; opacity: 1; }
    to { top: 0; opacity: 0; }
}

/* Button Loader Styles */
.button-loader {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

.button-loader.hidden {
    display: none;
} 

/* Evaluation Page Specific Styles */
.session-meta {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
}

.session-meta p {
    margin: 5px 0;
    font-size: 16px;
}

.button-group {
    margin-bottom: 25px;
}

.evaluation-container {
    display: flex;
    gap: 25px;
    align-items: flex-start;
}

.evaluation-form, .evaluation-results {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border: 1px solid #e0e0e0;
}

.evaluation-form {
    flex: 1;
}

.evaluation-results {
    flex: 2;
}

.evaluation-form h2, .evaluation-results h2 {
    margin-top: 0;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.evaluation-form form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.file-upload-label {
    display: inline-block;
    padding: 10px 15px;
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s;
}

.file-upload-label:hover {
    background-color: #e0e0e0;
}

.file-upload-label input[type="file"] {
    display: none;
}

#evaluation-status {
    margin-top: 15px;
    padding: 10px;
    border-radius: 5px;
    font-weight: 500;
}

.status-processing { background-color: #eef6ff; color: #3b82f6; }
.status-success { background-color: #f0fdf4; color: #16a34a; }
.status-error { background-color: #fef2f2; color: #ef4444; }

.metrics-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.metric-card {
    background-color: #f9fafb;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e5e7eb;
}

.metric-card h3 {
    margin: 0 0 5px 0;
    font-size: 16px;
    color: #4b5563;
}

.metric-card .metric-value {
    font-size: 28px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.metric-card small {
    font-size: 12px;
    color: #6b7280;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.results-table th, .results-table td {
    padding: 10px 12px;
    border: 1px solid #ddd;
    text-align: left;
}

.results-table th {
    background-color: #f7f7f7;
    font-weight: 600;
}

.no-results {
    color: #555;
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 5px;
    text-align: center;
}

.log-viewer {
    background-color: #1e1e1e;
    color: #d4d4d4;
    padding: 15px;
    border-radius: 5px;
    max-height: 400px;
    overflow-y: auto;
    font-family: 'Courier New', Courier, monospace;
}

.log-viewer pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Accordion Styles */
.accordion-container {
    margin-top: 25px;
}

.accordion {
    background-color: #f1f1f1;
    color: #444;
    cursor: pointer;
    padding: 18px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 15px;
    transition: background-color 0.4s ease;
    border-radius: 5px;
    margin-bottom: 5px;
}

.accordion.active, .accordion:hover {
    background-color: #ddd;
}

.accordion:after {
    content: '\\002B'; /* Unicode character for "plus" sign (+) */
    font-size: 13px;
    color: #777;
    float: right;
    margin-left: 5px;
}

.accordion.active:after {
    content: "\\2212"; /* Unicode character for "minus" sign (-) */
}

.panel {
    padding: 0 18px;
    background-color: white;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease-out;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 5px 5px;
}

.panel.active {
    overflow-y: auto;
    max-height: 400px; /* or any height you prefer */
}

/* Clips Page Specific Styles */
.summary {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 25px;
    border: 1px solid #ddd;
    text-align: left;
}

.clips-controls {
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#search-bar {
    width: 100%;
    padding: 12px;
    border: 1px solid #dfe6e9;
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
}

#clips-counter {
    color: #7f8c8d;
    font-style: italic;
    text-align: right;
    margin: 0;
}

.clips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.clip-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.clip-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.clip-card a {
    position: relative;
    display: block;
}

.clip-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 40px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.clip-card a:hover .play-icon {
    opacity: 1;
}

.clip-info {
    padding: 15px;
    text-align: left;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.clip-info .student-name {
    font-weight: 600;
    font-size: 1.1rem;
    margin: 0 0 5px 0;
}

.clip-info .timestamp {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin: 0 0 15px 0;
}

.clip-info .download-link {
    margin-top: auto;
    background-color: #f0f0f0;
    text-align: center;
    padding: 8px;
    border-radius: 5px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: background-color 0.2s;
}

.clip-info .download-link:hover {
    background-color: #e0e0e0;
}

/* Email Sender Page Styles */
.email-form-container {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
}

.email-form-container form {
    display: flex;
    align-items: center;
    gap: 15px;
}

.email-form-container label {
    font-weight: 600;
}

.email-form-container input[type="email"] {
    flex-grow: 1;
    padding: 12px;
    border: 1px solid #dfe6e9;
    border-radius: 8px;
    background-color: #fdfdfd;
    box-sizing: border-box;
    font-size: 1rem;
}

.email-form-container .button {
    width: auto; /* Override full-width default */
    flex-shrink: 0; /* Prevent button from shrinking */
}

.email-preview-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: flex-start;
}

.email-preview iframe {
    width: 100%;
    height: 600px;
    border: 1px solid #dfe6e9;
    border-radius: 8px;
}

/* Tab Styles */
.tab-container {
    width: 100%;
}

.tab-nav {
    display: flex;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 20px;
}

.tab-nav button {
    padding: 15px 25px;
    border: none;
    background-color: transparent;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    color: #868e96;
    position: relative;
    transition: color 0.2s ease;
}

.tab-nav button.active {
    color: #0d6efd;
    border-bottom: 2px solid #0d6efd;
    margin-bottom: -2px; /* Align with container border */
}

.tab-content {
    display: none;
    padding: 25px;
    border: 2px solid #e9ecef;
    border-top: none;
    border-radius: 0 0 8px 8px;
}

.tab-content.active {
    display: block;
}

/* Modal Styles for Email Test Page -- REMOVED AND UNIFIED ABOVE */

/* Nav Controls for bottom of page */
.nav-controls {
    width: 100%;
    margin-top: 30px; /* Add space from the content above */
    padding-top: 20px; /* Add space within the top border */
    border-top: 1px solid #e0e0e0; /* Add a separator line */
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.nav-controls .button,
.nav-controls .button-secondary {
    width: auto; /* Allow buttons to size to their content */
    flex-grow: 1;
}

.nav-controls .button-secondary {
    flex-grow: 0; /* Don't let secondary buttons grow as much */
} 

/* Email Distribution Styles */
.email-distribution-container {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-top: 25px;
}

.email-distribution-container h3 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.email-distribution-container p {
    color: #6c757d;
    margin-bottom: 15px;
    font-size: 1rem;
}

.email-distribution-container .button {
    background: #28a745;
    margin-top: 10px;
    width: auto;
    padding: 12px 24px;
}

.email-distribution-container .button:hover {
    background: #218838;
}

.email-distribution-container .button:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

#email-feedback {
    margin-top: 15px;
}

#email-feedback .status-processing {
    color: #856404;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 10px;
    border-radius: 4px;
    font-weight: 500;
}

#email-feedback .status-success {
    color: #155724;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    padding: 10px;
    border-radius: 4px;
    font-weight: 500;
}

#email-feedback .status-error {
    color: #721c24;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 10px;
    border-radius: 4px;
    font-weight: 500;
}

/* Email Mode Toggle Styles */
.email-mode-toggle {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.email-mode-toggle h3 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.mode-selection {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.mode-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.mode-option:hover {
    border-color: #007bff;
    background: #f8f9fa;
}

.mode-option input[type="radio"] {
    margin-right: 15px;
    transform: scale(1.2);
}

.mode-label {
    font-size: 1.1rem;
    font-weight: 500;
}

.mode-label.debug-mode {
    color: #17a2b8;
}

.mode-label.production-mode {
    color: #dc3545;
}

.mode-description {
    margin-top: 15px;
}

.mode-desc {
    display: none;
    padding: 15px;
    background: #e9ecef;
    border-radius: 6px;
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

.mode-desc.active {
    display: block;
}

.mode-desc strong {
    color: #495057;
}

/* Table Controls */
.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.table-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.stat-item {
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    font-size: 0.9rem;
}

.stat-item strong {
    color: #495057;
}

/* Data Table Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.data-table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.email-cell {
    font-family: monospace;
    font-size: 0.9rem;
}

.email-placeholder {
    color: #6c757d;
    font-style: italic;
}

.email-sent {
    color: #28a745;
    font-weight: 500;
}

.email-failed {
    color: #dc3545;
    font-weight: 500;
}

.loading, .error, .no-data {
    text-align: center;
    padding: 20px;
    color: #6c757d;
    font-style: italic;
}

.error {
    color: #dc3545;
} 

/* Thumbnail styles for email distribution table */
.thumbnail-cell {
    text-align: center;
    vertical-align: middle;
}

.thumbnail-img {
    max-width: 80px;
    max-height: 60px;
    border-radius: 4px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s ease;
    border: 2px solid #e9ecef;
    /* Add a subtle indicator that this is an animated GIF */
    position: relative;
}

.thumbnail-img:hover {
    transform: scale(1.05);
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.thumbnail-img:active {
    transform: scale(0.95);
}

/* Add a small GIF indicator for animated thumbnails */
.thumbnail-img::after {
    content: "GIF";
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 8px;
    padding: 1px 3px;
    border-radius: 2px;
    font-weight: bold;
    pointer-events: none;
}

/* Ensure table cells with thumbnails have proper spacing */
.data-table td.thumbnail-cell {
    padding: 8px;
    width: 100px;
}

.empty-table {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
    font-style: italic;
} 