/*
 * Squishy - Consolidated CSS file
 * ===============================
 * All styles for the Squishy application combined into a single optimized file.
 */

/*
 * TABLE OF CONTENTS:
 * -----------------
 * 1. Variables
 * 2. Base Styles & Reset
 * 3. Typography
 * 4. Layout & Container
 * 5. Header & Navigation
 * 6. Buttons & Form Elements
 * 7. Cards & Media Items
 * 8. Tables
 * 9. Media Grid & Library
 * 10. Media Details
 * 11. Show & Episode Styles
 * 12. Jobs & Progress
 * 13. Admin Styles
 * 14. Modals & Dialogs
 * 15. Notifications
 * 16. Loading & Empty States
 * 17. Utility Classes
 * 18. Responsive Styles
 * 19. Animations
 */

/* ========================================================================== */
/* 1. Variables
/* ========================================================================== */

:root {
  --primary-color: rgb(255, 202, 28);
  --secondary-color: rgb(20, 176, 161);
  --accent-color: rgb(144, 79, 168);
  --light-color: white;
  --dark-color: rgb(144, 79, 168);
  --text-color: #333;
  --success-color: rgb(20, 176, 161);
  --warning-color: rgb(255, 202, 28);
  --error-color: rgb(237, 56, 118);
}

/* ========================================================================== */
/* 2. Base Styles & Reset
/* ========================================================================== */

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--light-color);
}

a {
  color: var(--secondary-color);
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

hr {
  border: none;
  border-top: 1px solid #ddd;
  margin: 1.5rem 0;
}

.separator {
  margin: 1rem 0;
  border-top: 1px dashed #ddd;
}

/* ========================================================================== */
/* 3. Typography
/* ========================================================================== */

h1 {
  color: var(--accent-color);
}

h2 {
  color: var(--secondary-color);
  border-bottom: 2px solid var(--secondary-color);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--secondary-color);
  padding-bottom: 0.5rem;
}

.section-header h1,
.section-header h2 {
  margin-bottom: 0;
}

.section-header h2 {
  border-bottom: none;
}

.section-stats {
  color: #666;
  font-size: 0.9rem;
}

/* ========================================================================== */
/* 4. Layout & Container
/* ========================================================================== */

.container {
  max-width: 1200px;
  margin: 10rem auto; /* Increased from 8rem to 10rem for more space */
  padding: 0 2rem;
}

/* ========================================================================== */
/* 5. Header & Navigation
/* ========================================================================== */

header {
  background-color: var(--primary-color);
  padding: 0.5rem 0;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  z-index: 9999;
  border-bottom: 0.5rem solid var(--accent-color);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0rem 2rem; /* Added vertical padding for more space */
}

.logo a {
  color: white;
  font-size: 1.5rem;
  font-weight: bold;
  text-decoration: none;
}

.logo img {
  position: fixed;
  top: 0.5rem;
  height: 100px;
}

nav ul {
  display: flex;
  list-style: none;
}

nav ul li {
  margin-left: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

nav ul li.active {
  background-color: var(--accent-color);
  padding: 1px 1rem;
}
nav ul li.active a {
  color: white;
}

nav ul li a {
  text-decoration: none;
  font-family: "Concert One", serif;
  font-weight: 300;
  font-style: normal;
  text-transform: lowercase;
  font-size: 20pt;
  color: var(--accent-color);
}

nav ul li a:hover {
  color: var(--secondary-color);
}

/* ========================================================================== */
/* 6. Buttons & Form Elements
/* ========================================================================== */

/* Button styles */
button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--secondary-color);
  color: white;
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  text-decoration: none;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 1rem;
  height: 38px;
  box-sizing: border-box;
  transition: background-color 0.2s ease;
}

button:hover,
.button:hover {
  background-color: #2980b9;
  text-decoration: none;
}

.button.small,
button.small {
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
  height: 32px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  box-sizing: border-box;
}

.button.mini,
button.mini {
  font-size: 0.8rem;
  padding: 0.3rem 0.7rem;
  height: 28px;
}

.button.danger,
button.danger {
  background-color: var(--error-color);
}

.button.danger:hover,
button.danger:hover {
  background-color: #c0392b;
}

.button.success,
button.success {
  background-color: var(--success-color);
}

.button.success:hover,
button.success:hover {
  background-color: #219652;
}

.button.secondary,
button.secondary {
  background-color: #95a5a6;
}

.button.secondary:hover,
button.secondary:hover {
  background-color: #7f8c8d;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.back-button {
  display: inline-flex;
  align-items: center;
  background-color: var(--primary-color);
  transition: background-color 0.2s ease;
}

.back-button:hover {
  background-color: #34495e;
  text-decoration: none;
}

.back-button-container {
  margin-bottom: 1rem;
}

/* Circle action buttons */
.circle-button {
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: transform 0.2s;
  position: relative;
  background: transparent;
  text-decoration: none;
  padding: 0;
}

.circle-button img {
  width: 24px;
  height: 24px;
}

.circle-button:hover {
  transform: scale(1.2);
}

.action-buttons-container {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-start;
}

/* Form elements */
form {
  width: 100%;
  box-sizing: border-box;
}

.form-group {
  margin-bottom: 1rem;
  width: 100%;
}

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

.form-group select,
.form-group input[type="text"],
.form-group textarea,
input[type="number"],
input[type="password"] {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 0.9rem;
}

.form-group textarea {
  resize: vertical;
}

.help-text {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0.5rem;
}

.form-submit {
  margin-top: 1.5rem;
}

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

/* Input with button */
.input-with-button {
  display: flex;
  gap: 0.5rem;
}

.input-with-button textarea,
.input-with-button input {
  flex: 1;
}

.browse-button {
  align-self: flex-start;
  white-space: nowrap;
}

/* Radio & checkbox groups */
.radio-group,
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
  width: 100%;
}

.radio-group label,
.checkbox-group label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: normal;
  margin-bottom: 0;
}

.radio-group input[type="radio"],
.checkbox-group input[type="checkbox"] {
  margin-right: 0.5rem;
}

/* Toggle switch */
.toggle-switch {
  display: flex;
  align-items: center;
  position: relative;
  cursor: pointer;
}

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

.toggle-slider {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
  background-color: #ccc;
  border-radius: 20px;
  margin-right: 10px;
  transition: .3s;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  border-radius: 50%;
  transition: .3s;
}

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

input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

.toggle-label {
  flex: 1;
  font-weight: 500;
}

/* Search form */
.search-container {
  margin: 0;
}

.search-form {
  display: flex;
  width: 320px;
  align-items: center;
  margin-right: 0;
}

.search-form input {
  flex: 1;
  padding: 0.5rem 0.7rem;
  border: 1px solid #ddd;
  border-radius: 4px 0 0 4px;
  font-size: 0.9rem;
  height: 38px;
  box-sizing: border-box;
}

.search-form button {
  border-radius: 0 4px 4px 0;
  margin-left: -1px;
  height: 38px;
  padding: 0 0.9rem;
  font-size: 0.9rem;
}

.clear-search {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.4rem 0.5rem;
  color: var(--primary-color);
  text-decoration: none;
  font-size: 0.85rem;
}

.clear-search:hover {
  text-decoration: underline;
}

/* Source fields */
.source-fields {
  margin-top: 1rem;
  padding: 1rem;
  background-color: #f9f9f9;
  border-radius: 4px;
  border-left: 3px solid var(--secondary-color);
  box-sizing: border-box;
  width: 100%;
}

/* ========================================================================== */
/* 7. Cards & Media Items
/* ========================================================================== */

.card {
  padding: 1.5rem;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  width: 100%;
}

.card h3 {
  margin-bottom: 0.75rem;
  color: var(--dark-color);
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
}

td.align-right .action-buttons {
  justify-content: flex-end;
  width: 100%;
}

/* ========================================================================== */
/* 8. Tables
/* ========================================================================== */

table {
  width: 100%;
  border-collapse: collapse;
  background-color: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

/* Responsive table wrapper */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.table-responsive table {
  margin-bottom: 0;
  box-shadow: none;
}

thead {
  background-color: var(--primary-color);
  color: var(--accent-color);
  font-weight: 600;
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

th.align-right,
td.align-right {
  text-align: right !important;
  align-items: right !important;
  white-space: nowrap;
}

.align-right {
  text-align: right;
}

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

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

tbody tr:hover {
  background-color: #f5f5f5;
}

/* Status styling */
.status {
  text-transform: capitalize;
}

.status-complete,
.status-completed {
  color: var(--success-color);
  font-weight: 500;
}

.status-failed {
  color: var(--error-color);
  font-weight: 500;
}

.status-pending {
  color: var(--warning-color);
  font-weight: 500;
}

.status-processing {
  color: var(--warning-color);
  font-weight: 500;
}

.status-cancelled {
  color: #7f8c8d;
  font-weight: 500;
  text-decoration: line-through;
}

/* ========================================================================== */
/* 9. Media Grid & Library
/* ========================================================================== */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.media-card {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background-color: white;
  height: 100%;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.3s ease-in-out;
}

.media-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.media-card a {
  text-decoration: none;
  color: var(--text-color);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.media-card img {
  width: 100%;
  aspect-ratio: 2/3; /* Standard movie poster aspect ratio */
  object-fit: cover; /* Use cover for consistent look */
  object-position: center top; /* Focus on top of poster which usually has faces/title */
  display: block;
  background-color: #eee; /* Add background for transparent posters */
}

.placeholder-poster {
  background-color: var(--secondary-color);
  width: 100%;
  aspect-ratio: 2/3; /* Match the image aspect ratio */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: white;
}

.placeholder-poster.large {
  height: 400px;
  font-size: 5rem;
}

.media-info {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.media-info h3 {
  margin-bottom: 0.25rem;
  font-size: 0.85rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-weight: 600;
}

.media-type {
  font-size: 0.7rem;
  color: var(--secondary-color);
  margin-top: auto;
}

.media-count {
  font-size: 0.7rem;
  color: #777;
  margin-top: 0.25rem;
  display: block;
}

/* Library header */
.library-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.library-header h1 {
  margin: 0;
}

/* Pagination styles */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 2rem 0;
  padding: 1rem;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pagination-info {
  color: #666;
}

.pagination-controls {
  display: flex;
  gap: 0.5rem;
}

.pagination-prev,
.pagination-next,
.pagination-page {
  display: inline-block;
  padding: 0.5rem 1rem;
  background-color: #f5f5f5;
  color: var(--secondary-color);
  border-radius: 4px;
  text-decoration: none;
}

.pagination-page.active {
  background-color: var(--secondary-color);
  color: white;
}

.pagination-prev:hover,
.pagination-next:hover,
.pagination-page:hover:not(.active) {
  background-color: #e0e0e0;
}

/* Library toggles */
.library-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.library-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.library-item {
  background-color: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 0.75rem;
}

.library-type {
  color: #777;
  display: block;
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

/* ========================================================================== */
/* 10. Media Details
/* ========================================================================== */

.media-detail h1 {
  margin: 1rem 0 1rem;
  color: var(--accent-color);
}

.media-detail .admin-section {
  margin-bottom: 2rem;
}

.media-detail .admin-section h2 {
  margin-bottom: 1rem;
}

.media-detail .card {
  background-color: white;
  border-radius: 5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
}

.media-detail table {
  width: 100%;
  border-collapse: collapse;
}

.media-detail table th,
.media-detail table td {
  padding: 0.5rem;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.media-detail table th {
  width: 30%;
  font-weight: bold;
  color: var(--dark-color);
}

/* Media header styles */
.media-header,
.show-header {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
  align-items: flex-start;
}

.media-poster,
.show-poster {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  max-width: 312px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.media-info h1 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.media-meta {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.media-type-pill,
.resolution-pill,
.hdr-pill,
.seasons-pill,
.episodes-pill {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.movie-type {
  background-color: #3498db25;
  color: #3498db;
}

.tv-type {
  background-color: #9b59b625;
  color: #9b59b6;
}

.resolution-pill {
  background-color: #27ae6025;
  color: #27ae60;
}

.hdr-pill {
  background-color: #f39c1225;
  color: #f39c12;
}

.seasons-pill {
  background-color: rgba(52, 152, 219, 0.15);
  color: #3498db;
}

.episodes-pill {
  background-color: rgba(39, 174, 96, 0.15);
  color: #27ae60;
}

.media-description {
  margin-bottom: 1rem;
  color: #555;
  line-height: 1.5;
}

.media-metadata {
  margin-bottom: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.5rem 1rem;
}

.metadata-item {
  display: flex;
  align-items: baseline;
}

.metadata-label {
  font-weight: 600;
  color: var(--dark-color);
  margin-right: 0.5rem;
  white-space: nowrap;
}

.metadata-value {
  color: #555;
}

.media-path {
  margin: 1rem 0;
  font-size: 0.9rem;
  color: #666;
  word-break: break-all;
}

.transcode-form {
  margin-top: 2rem;
  padding: 1.5rem;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ========================================================================== */
/* 11. Show & Episode Styles
/* ========================================================================== */

/* Show details section */
.show-details {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  background-color: #f9f9f9;
  padding: 1rem;
  border-radius: 8px;
}

.detail-item {
  min-width: 150px;
}

.detail-label {
  font-weight: 600;
  color: #555;
  margin-bottom: 0.3rem;
}

.detail-value {
  color: #333;
}

/* Season section */
.admin-section {
  margin-bottom: 3rem;
}

.admin-section h2 {
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
}

.seasons-container {
  margin-top: 2rem;
}

.season-block {
  margin-bottom: 2rem;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.season-title {
  padding: 1rem;
  background-color: var(--primary-color);
  color: white;
  margin: 0;
}

.episodes-list {
  padding: 1rem;
}

.episode-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #eee;
}

.episode-item:last-child {
  border-bottom: none;
}

.episode-title {
  margin: 0;
  font-size: 1.1rem;
}

.episode-path {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: #666;
  max-width: 400px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.episode-actions .transcode-form {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0;
  padding: 0;
  background: none;
  box-shadow: none;
}

.episode-actions .form-group {
  margin: 0;
}

.episode-actions select {
  width: auto;
}

/* Episodes table with thumbnails */
.episodes-table {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.episode-row {
  display: flex;
  border: 1px solid #eee;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  background-color: white;
  height: 160px; /* Fixed height for consistent card sizing */
}

.episode-artwork {
  width: 280px; /* Increased width for better aspect ratio */
  height: 100%;
  overflow: hidden;
  background-color: #f5f5f5;
  flex-shrink: 0; /* Prevent artwork from shrinking */
}

.episode-artwork img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.episode-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.placeholder-thumbnail {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #fff;
  background-color: var(--secondary-color);
  font-weight: bold;
}

.episode-content {
  flex: 1;
  padding: 1rem;
  min-width: 0; /* Ensures text wrapping */
  display: flex;
  flex-direction: column;
  overflow: hidden; /* Prevent content overflow */
}

.episode-title {
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
  font-size: 1.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.episode-description {
  margin-bottom: 0.5rem;
  color: #555;
  font-size: 0.9rem;
  line-height: 1.4;
  flex: 1; /* Allow description to take available space */
  /* Multi-line ellipsis for long descriptions */
  display: -webkit-box;
  -webkit-line-clamp: 3; /* Limit to 3 lines */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.episode-air-date {
  font-size: 0.8rem;
  color: #777;
  margin-bottom: 0;
}

.episode-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  border-left: 1px solid #eee;
  min-width: 120px;
  flex-shrink: 0; /* Prevent shrinking */
}

.tech-info-btn,
.squish-btn {
  padding: 0.5rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.2s;
}

.tech-info-btn {
  background-color: #f0f0f0;
  color: #555;
}

.tech-info-btn:hover {
  background-color: #e0e0e0;
}

.squish-btn {
  background-color: var(--secondary-color);
  color: white;
}

.squish-btn:hover {
  background-color: var(--secondary-dark-color, #e07c00);
}

/* Episode info */
.episode-info {
  font-size: 0.9rem;
  color: var(--secondary-color);
  margin-top: 0.25rem;
}

/* Tech Info Content Styles */
#techInfoContent {
  font-size: 0.9rem;
}

.tech-section {
  margin-bottom: 1.5rem;
}

.tech-section h4 {
  margin-top: 0;
  margin-bottom: 0.8rem;
  color: var(--primary-color);
  font-size: 1.1rem;
  border-bottom: 1px solid #eee;
  padding-bottom: 0.3rem;
}

.tech-card {
  background-color: #f9f9f9;
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.tech-card:last-child {
  margin-bottom: 0;
}

.tech-card table {
  width: 100%;
  border-collapse: collapse;
}

.tech-card table th,
.tech-card table td {
  padding: 0.5rem;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.tech-card table tr:last-child th,
.tech-card table tr:last-child td {
  border-bottom: none;
}

.tech-card table th {
  width: 30%;
  font-weight: 600;
  color: #555;
}

/* ========================================================================== */
/* 12. Jobs & Progress
/* ========================================================================== */

.jobs-list h1 {
  margin-bottom: 1.5rem;
}

.jobs-list h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
}

.jobs-list h2:first-of-type {
  margin-top: 1rem;
}

.jobs-list table td:last-child form {
  width: auto;
}

progress {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  flex-grow: 1;
}

/* Progress styling */
.progress-container {
  display: flex;
  flex-direction: column;
}

.progress-bar-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.progress-text {
  font-size: 0.6rem;
  color: var(--dark-color);
  font-weight: 500;
  min-width: 3.5em;
  text-align: right;
}

.progress-time {
  font-size: 0.6rem;
  color: var(--secondary-color);
  font-family: monospace;
}

.output-size {
  display: block;
  font-size: 0.8rem;
  color: var(--secondary-color);
  margin-top: 0.25rem;
}

/* Queue position */
.queue-position {
  font-size: 0.8rem;
  color: var(--secondary-color);
  margin-left: 0.5rem;
}

/* ========================================================================== */
/* 13. Admin Styles
/* ========================================================================== */

.admin-dashboard {
  max-width: 800px;
  margin: 0 auto;
}

.admin-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.admin-section {
  margin-bottom: 2rem;
  width: 100%;
}

.admin-section h2 {
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--secondary-color);
  padding-bottom: 0.5rem;
}

.admin-section h3 {
  margin-bottom: 0.75rem;
  color: var(--dark-color);
  font-size: 1.2rem;
  font-weight: 600;
}

/* Profiles management */
.profiles-list h1 {
  margin-bottom: 1rem;
}

.profiles-list table {
  margin-top: 1rem;
}

.profiles-list form {
  width: auto;
}

.profiles-list .actions {
  display: flex;
  justify-content: right; /* Align items horizontally */
  margin-top: 1.5rem;
}

.actions {
  margin-bottom: 1.5rem;
}

.actions.right-aligned {
  text-align: right;
}

.inline-form {
  display: inline-flex;
  vertical-align: middle;
  margin: 0;
}

.delete-form,
.cancel-form,
.remove-form {
  display: inline-block;
  margin: 0;
  padding: 0;
}

/* Path mapping */
.path-mapping-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  background-color: #f9f9f9;
  border-radius: 4px;
  padding: 1rem;
}

.mapping-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  flex: 1;
}

.mapping-actions {
  margin-left: 1rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.path-mapping-row .form-group {
  margin-bottom: 0;
}

.path-mapping-empty {
  background-color: #f9f9f9;
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 1rem;
  border-left: 3px solid var(--warning-color);
}

.path-mapping-empty p {
  margin: 0;
  color: #666;
}

/* Hardware acceleration indicators */
.hw-inherit,
.hw-enabled,
.hw-disabled,
.failover-enabled,
.failover-disabled {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
}

.hw-inherit {
  background-color: #3498db25;
  color: #3498db;
}

.hw-enabled {
  background-color: #27ae6025;
  color: #27ae60;
}

.hw-disabled {
  background-color: #7f8c8d25;
  color: #7f8c8d;
}

.failover-enabled {
  background-color: #27ae6025;
  color: #27ae60;
}

.failover-disabled {
  background-color: #e74c3c25;
  color: #e74c3c;
}

/* Hardware acceleration results */
#hwaccel-results {
  margin-top: 20px;
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 4px;
}

#hwaccel-results h3 {
  margin-top: 0;
  margin-bottom: 10px;
  color: #2c3e50;
  font-size: 1.1rem;
}

#hwaccel-results h4 {
  margin-top: 15px;
  margin-bottom: 5px;
  color: #34495e;
  font-size: 1rem;
}

#hwaccel-results ul {
  list-style-type: disc;
  padding-left: 20px;
}

#hwaccel-results li {
  margin-bottom: 5px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
}

/* Hardware acceleration summary section */
.hw-summary-section {
  margin-bottom: 20px;
  background-color: #f9f9f9;
  padding: 15px;
  border-radius: 4px;
  border-left: 3px solid var(--secondary-color);
}

.recommended-hw {
  margin-top: 15px;
  background-color: #e8f7f6;
  padding: 10px;
  border-radius: 4px;
  border-left: 3px solid var(--success-color);
}

/* Hardware capabilities JSON editor */
.capabilities-json {
  margin-top: 20px;
  background-color: #f9f9f9;
  padding: 15px;
  border-radius: 4px;
  border-left: 3px solid var(--accent-color);
}

.capabilities-actions {
  margin-top: 15px;
  display: flex;
  gap: 10px;
}

.advanced-note {
  background-color: #fff4e5;
  padding: 10px;
  border-radius: 4px;
  border-left: 3px solid var(--warning-color);
  margin: 10px 0;
  font-size: 0.9rem;
}

.error {
  color: #e74c3c;
  font-weight: bold;
}

/* FFmpeg logs styling */
.logs-row td {
  padding: 0;
}

.logs-container {
  padding: 1.5rem;
  background-color: #f8f9fa;
  border-left: 3px solid var(--secondary-color);
  margin: 0;
}

.logs-container h3 {
  color: var(--primary-color);
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.ffmpeg-command,
.ffmpeg-logs {
  background-color: #2c3e50;
  color: #ecf0f1;
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  white-space: pre-wrap;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.85rem;
  line-height: 1.4;
  max-height: 300px;
  overflow-y: auto;
}

.ffmpeg-command {
  margin-bottom: 1.5rem;
}

.toggle-logs-button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  margin-top: 0.5rem;
  margin-left: 0.5rem;
}

.toggle-logs-button:hover {
  background-color: #34495e;
}

/* Auto refresh toggle */
.auto-refresh-toggle {
  margin-top: 1rem;
  display: flex;
  align-items: center;
}

.auto-refresh-toggle label {
  display: flex;
  align-items: center;
  font-size: 0.85rem;
  color: var(--secondary-color);
  cursor: pointer;
}

.auto-refresh-toggle input[type="checkbox"] {
  margin-right: 0.5rem;
}

/* ========================================================================== */
/* 14. Modals & Dialogs
/* ========================================================================== */

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
  /* Add flexbox for better centering */
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: white;
  margin: 0 auto;
  padding: 0;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  width: 80%;
  max-width: 700px;
  max-height: 80vh;
  overflow: hidden;
  position: relative;
}

.modal-header {
  padding: 1rem;
  background-color: var(--primary-color);
  color: white;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: white;
  border-bottom: none;
  padding-bottom: 0;
}

.close,
.close-modal {
  color: white;
  font-size: 1.8rem;
  font-weight: bold;
  cursor: pointer;
}

.close-modal {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 1.5rem;
  color: #aaa;
  z-index: 2;
}

.close-modal:hover {
  color: #555;
}

.modal-body {
  padding: 1rem;
  overflow-y: auto;
  max-height: calc(80vh - 2rem);
}

.modal-body h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--dark-color);
  border-bottom: 1px solid #eee;
  padding-bottom: 0.5rem;
}

.modal-footer {
  padding: 1rem;
  background-color: #f5f5f5;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

/* Squish modal specific styling */
#squishModal .modal-content {
  max-width: 500px;
}

#squishModal .modal-body {
  padding: 1.5rem;
  max-height: none;
}

#squishForm {
  margin-bottom: 0.5rem;
}

#squishForm .form-group {
  margin-bottom: 1rem;
}

#squishForm .form-submit {
  margin-top: 0.5rem;
}

/* File browser styles */
.current-path {
  padding: 0.5rem;
  background-color: #f5f5f5;
  border-radius: 4px;
  margin-bottom: 1rem;
  word-break: break-all;
  font-family: monospace;
}

.directory-list {
  border: 1px solid #ddd;
  border-radius: 4px;
}

.directory-item {
  padding: 0.75rem;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.directory-item:last-child {
  border-bottom: none;
}

.directory-item:hover {
  background-color: #f5f5f5;
}

.directory-icon,
.file-icon {
  margin-right: 0.5rem;
}

.directory-item.parent {
  background-color: #f9f9f9;
}

.file-item {
  color: #3498db;
}

/* ========================================================================== */
/* 15. Notifications
/* ========================================================================== */

/* Flash messages (legacy - will be removed) */
.flash {
  display: none; /* Hide traditional flash messages since we're using notifications now */
}

/* Notifications */
#notification-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}

.notification {
  animation: slide-up 0.3s ease-out;
  max-width: 320px;
}

.notification-content {
  background-color: rgba(44, 62, 80, 0.95);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  border-left: 4px solid var(--secondary-color);
}

.notification-mascot {
  width: 40px;
  height: 40px;
  margin-right: 15px;
  flex-shrink: 0;
}

.notification-mascot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

.notification-message {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 500;
}

.notification.success .notification-content {
  border-left-color: var(--success-color);
}

.notification.error .notification-content {
  border-left-color: var(--error-color);
}

.notification.warning .notification-content {
  border-left-color: var(--warning-color);
}

/* Mascot animation in notifications */
.notification-mascot img {
  animation: mascot-bounce 0.5s ease;
}

@keyframes mascot-bounce {
  0% { transform: scale(0.5); opacity: 0; }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

/* Custom tooltip solution */
.tooltip-container {
  position: fixed;
  display: none;
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  z-index: 9999;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Elements with tooltips */
[data-tooltip] {
  position: relative;
}

/* ========================================================================== */
/* 16. Loading & Empty States
/* ========================================================================== */

/* Empty state */
.empty-state {
  padding: 3rem;
  text-align: center;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.empty-state-mascot {
  flex-shrink: 0;
}

.empty-state-mascot img {
  max-width: 120px;
  max-height: 120px;
  width: 100%;
  height: auto;
}

.empty-state p {
  color: #777;
  font-size: 1.1rem;
  text-align: left;
}

/* Jobs page specific empty states */
.jobs-list .empty-state {
  padding: 2rem;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 1.5rem;
  text-align: left;
}

.jobs-list .empty-state-mascot {
  width: 120px;
  height: 120px;
  flex-shrink: 0;
  margin-bottom: 0;
}

.jobs-list .empty-state .speech-bubble {
  position: relative;
  background-color: #f5f5f5;
  border-radius: 20px;
  padding: 1rem 1.5rem;
  font-size: 1.1rem;
  color: var(--text-color);
  max-width: 70%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  margin-left: 15px;
}

.jobs-list .empty-state .speech-bubble:before {
  content: "";
  position: absolute;
  left: -15px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-right: 15px solid #f5f5f5;
}

/* ========================================================================== */
/* Completed Transcodes Page
/* ========================================================================== */

.completed-list h1 {
  margin-bottom: 1rem;
}

.transcode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.transcode-card {
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  background-color: white;
  transition: transform 0.2s, box-shadow 0.2s;
}

.transcode-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.transcode-poster {
  height: 200px;
  overflow: hidden;
  position: relative;
}

.transcode-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.no-poster {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f5f5f5;
  color: #999;
}

.transcode-details {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 0;
  min-height: 220px;
}

.transcode-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.transcode-title {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.transcode-title .show-title {
  color: var(--secondary-color);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.2rem;
}

.transcode-info {
  display: flex;
  flex-direction: column;
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}

.file-size {
  color: #27ae60;
}

.transcode-date {
  color: #666;
}

.transcode-actions {
  margin-top: 0.5rem;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  border-top: 1px solid #eee;
  padding-top: 0.5rem;
}

.transcode-actions-left {
  display: flex;
  gap: 0.5rem;
}

.delete-form {
  display: inline-block;
  margin: 0;
  padding: 0;
}

/* Loading spinner */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

.loading-spinner {
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top: 4px solid var(--secondary-color);
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

.loader {
  border: 2px solid #f3f3f3;
  border-top: 2px solid var(--secondary-color);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
  margin-left: 8px;
  display: inline-block;
  vertical-align: middle;
}

/* ========================================================================== */
/* 17. Utility Classes
/* ========================================================================== */

.hidden {
  display: none !important;
}

.full-width {
  width: 100%;
}

.fade-in {
  animation: fade-in 0.5s ease-in;
}

/* Preset pill overlay */
.preset-pill-overlay {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  background-color: rgba(52, 152, 219, 0.8);
  color: white;
  z-index: 5;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ========================================================================== */
/* 18. Responsive Styles
/* ========================================================================== */

/* Mobile menu toggle */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1000;
  width: 40px;
  height: 40px;
  position: relative;
  margin-right: 0.25rem;
}

.mobile-menu-toggle:focus {
  outline: 2px solid rgba(144, 79, 168, 0.5);
  border-radius: 4px;
}

.menu-bar {
  display: block;
  width: 25px;
  height: 3px;
  margin: 5px 0;
  background-color: var(--accent-color);
  border-radius: 3px;
  transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

@media (max-width: 768px) {
  /* Layout adjustments */
  .container {
    padding: 0 1rem;
    margin-top: 6.5rem; /* Increased to accommodate larger logo */
    margin-bottom: 2rem; /* Added for better spacing at the bottom */
  }

  /* Tables responsive styles */
  th, td {
    padding: 0.5rem;
    min-width: 100px; /* Ensure columns have minimum width on mobile */
  }

  /* Column widths for jobs table */
  .col-media { min-width: 180px; }
  .col-size { min-width: 100px; }
  .col-preset { min-width: 110px; }
  .col-status { min-width: 100px; }
  .col-progress { min-width: 120px; }
  .col-actions { min-width: 100px; }

  /* Optimize progress bar display */
  .progress-container {
    max-width: 120px;
  }

  .progress-bar-row {
    flex-wrap: nowrap;
  }

  progress {
    height: 6px; /* Smaller height on mobile */
  }

  .progress-text {
    font-size: 0.55rem; /* Smaller font on mobile */
    min-width: 2.5em; /* Smaller width on mobile */
  }

  .progress-time {
    font-size: 0.55rem; /* Smaller font on mobile */
  }

  .action-buttons-container {
    gap: 0.25rem; /* Smaller gap on mobile */
  }

  .circle-button {
    width: 2rem; /* Smaller button on mobile */
    height: 2rem; /* Smaller button on mobile */
  }

  .circle-button img {
    width: 16px; /* Smaller icon on mobile */
    height: 16px; /* Smaller icon on mobile */
  }

  /* Responsive cell content */
  .responsive-ellipsis {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
  }

  /* Navigation */
  header {
    height: 55px; /* Set specific height for mobile header */
    padding: 0;
  }

  nav {
    padding: 0;
    position: relative;
    height: 55px; /* Match header height */
    justify-content: center; /* Center nav items */
  }

  .logo {
    z-index: 1001;
  }

  .logo img {
    position: absolute;
    height: 80px; /* Increased from 40px to match desktop style */
    top: 0;
    left: 20px;
    z-index: 1002;
  }

  .mobile-menu-toggle {
    display: block;
    position: absolute;
    right: 15px;
    top: 6px; /* Adjusted from 12px to move it up */
  }

  .nav-menu {
    position: absolute;
    top: 55px; /* Align with bottom of the header */
    left: 0;
    width: 100%;
    flex-direction: column;
    background-color: var(--primary-color);
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
    z-index: 1000;
    border-bottom: 0.5rem solid var(--accent-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0);
    transition: max-height 0.3s ease, box-shadow 0.3s ease;
  }

  .nav-menu.open {
    max-height: 300px; /* Enough height for all menu items */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  }

  nav ul li {
    margin: 0;
    width: 100%;
    text-align: center;
    padding: 1rem 0;
  }

  /* Media headers */
  .media-header,
  .show-header {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .media-poster,
  .show-poster,
  .placeholder-poster.large {
    height: 300px;
    max-width: 180px;
  }

  .placeholder-poster.large {
    font-size: 3rem;
  }

  .show-info {
    text-align: center;
  }

  .media-meta {
    justify-content: center;
  }

  /* Tables */
  th, td {
    padding: 0.5rem;
  }

  /* Episodes */
  .episode-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .episode-actions {
    margin-top: 1rem;
    width: 100%;
  }

  .episode-actions .transcode-form {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }

  .episode-actions select {
    width: 100%;
  }

  /* Episode rows */
  .episode-row {
    flex-direction: column;
    height: auto; /* Reset fixed height on mobile */
    max-height: none;
  }

  .episode-artwork {
    width: 100%;
    height: 180px; /* Taller on mobile for better viewing */
  }

  .episode-actions {
    flex-direction: row;
    flex-wrap: wrap;
    border-left: none;
    border-top: 1px solid #eee;
    justify-content: space-around;
    gap: 0.5rem;
    padding: 0.8rem;
  }

  .episode-actions button {
    flex: 1;
    min-width: 110px;
  }

  /* Search */
  .search-container form {
    flex-wrap: wrap;
  }

  .search-container input {
    flex: 1 1 100%;
    border-radius: 4px;
    margin-bottom: 0.5rem;
  }

  .search-container button {
    flex: 1;
    border-radius: 4px;
    margin-left: 0;
  }

  .clear-search {
    flex: 1;
    text-align: center;
    margin-left: 0.5rem;
  }

  /* Pagination */
  .pagination {
    flex-direction: column;
    gap: 1rem;
  }

  .pagination-info {
    text-align: center;
  }

  .pagination-controls {
    flex-wrap: wrap;
    justify-content: center;
  }

  /* Section headers */
  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-stats {
    margin-top: 0.5rem;
  }

  /* Library header */
  .library-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-container {
    margin-top: 1rem;
    width: 100%;
  }

  .search-form {
    width: 100%;
    max-width: 100%;
  }

  /* Admin */
  .path-mapping-row {
    grid-template-columns: 1fr;
  }

  .library-group {
    grid-template-columns: 1fr;
  }
}

/* ========================================================================== */
/* 19. Animations
/* ========================================================================== */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slide-up {
  0% {
    transform: translateY(100%);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fade-out {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* Mascot animations */
@keyframes slide-in-from-left {
  0% { transform: translateX(-150px); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateX(0); opacity: 1; }
}

@keyframes slide-in-from-right {
  0% { transform: translateX(150px); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateX(0); opacity: 1; }
}

@keyframes slide-in-from-top {
  0% { transform: translateY(-150px); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes slide-in-from-bottom {
  0% { transform: translateY(150px); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-30px); }
  60% { transform: translateY(-15px); }
}

@keyframes sway {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(-5deg); }
  50% { transform: rotate(0deg); }
  75% { transform: rotate(5deg); }
  100% { transform: rotate(0deg); }
}

/* Mascot container styling */
#mascot-container {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 150px;
  height: 150px;
  z-index: 999;
  pointer-events: none; /* Allow clicks to pass through */
}

#mascot-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Animation classes */
.mascot-processing {
  animation: slide-in-from-left 1s ease forwards, sway 3s ease infinite;
}

.mascot-processing.from-right {
  animation: slide-in-from-right 1s ease forwards, sway 3s ease infinite;
}

.mascot-processing.from-top {
  animation: slide-in-from-top 1s ease forwards, sway 3s ease infinite;
}

.mascot-processing.from-bottom {
  animation: slide-in-from-bottom 1s ease forwards, sway 3s ease infinite;
}

.mascot-success {
  animation: bounce 2s ease 1;
}

.mascot-failed {
  animation: sway 4s ease infinite;
  transform-origin: top center;
}

/* ========================================================================== */
/* Splash Screen
/* ========================================================================== */

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* Tilting animation for logo and mascot */
@keyframes tiltLeftRight {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-5deg); }
  75% { transform: rotate(5deg); }
}

/* Zoom animation for logo and mascot */
@keyframes pulseZoom {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Combined tilt and zoom animation */
@keyframes zoomIn {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes tiltAndZoom {
  0%, 100% {
    transform: rotate(0deg) scale(1);
  }
  25% {
    transform: rotate(-5deg) scale(1.03);
  }
  75% {
    transform: rotate(5deg) scale(1.03);
  }
}

#splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.92);
  background-image: url('/static/img/background.jpg');
  background-size: cover;
  background-position: center;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  transition: opacity 0.5s ease-in-out;
}

.splash-content {
  text-align: center;
  padding: 2rem;
  max-width: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.splash-logo {
  margin-bottom: 1rem;
  display: block;
  position: relative;
  animation: zoomIn 0.8s ease-out 0.4s forwards, tiltAndZoom 3s ease-in-out 1.2s infinite;
  width: 100%;
  opacity: 0;
  transform: scale(0.5);
}

.splash-logo img {
  max-width: 95%;
  max-height: 300px;
  filter: drop-shadow(0 0 25px rgba(255, 202, 28, 0.8));
}

.splash-welcome {
  margin-bottom: 0.5rem;
  display: block;
  width: 100%;
  text-align: center;
  animation: zoomIn 0.6s ease-out forwards;
  opacity: 0;
  transform: scale(0.5);
}

.splash-welcome h1 {
  font-family: 'Concert One', cursive;
  font-size: 2.5rem;
  margin: 0;
  color: white;
  text-shadow: 0 0 20px rgba(255, 202, 28, 0.8);
  letter-spacing: 2px;
}

.splash-mascot {
  margin-bottom: 1rem;
  display: block;
  animation: zoomIn 0.8s ease-out 0.2s forwards, tiltAndZoom 3s ease-in-out 1s infinite reverse;
  width: 100%;
  opacity: 0;
  transform: scale(0.5);
}

.splash-mascot img {
  max-height: 250px;
  filter: drop-shadow(0 0 15px rgba(144, 79, 168, 0.8));
}

.splash-loading {
  margin-top: 2rem;
  font-family: 'Concert One', cursive;
  color: white;
  font-size: 1.8rem;
  text-shadow: 0 0 10px rgba(144, 79, 168, 0.8);
  animation: fadeIn 1s ease-in 1.5s forwards;
  opacity: 0;
}

.dot-animation:after {
  content: '.';
  animation: dots 1.5s steps(5, end) infinite;
}

@keyframes dots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60% { content: '...'; }
  80%, 100% { content: ''; }
}

.fade-out {
  animation: fadeOut 0.5s ease-in-out forwards;
}
