:root {
    --bg: #ffffff;
    --fg: #111111;
    --card-bg: #f5f5f5;
    --accent: #111111;
    --movie: #d4a017;
    --tv: #3fa9f5;
}

body.dark {
    --bg: #111111;
    --fg: #f5f5f5;
    --card-bg: #1e1e1e;
    --accent: #f5f5f5;
    --movie: #ffcc4d;
    --tv: #6ec6ff;
}

body {
    font-family: Arial, sans-serif;
    background: var(--bg);
    color: var(--fg);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 60px;
    transition: background 0.3s, color 0.3s;
}

h1 {
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 28px;
}

.subtitle {
    margin-bottom: 25px;
    opacity: 0.7;
}

.search-box {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap; 
  gap: 0.5em;      /* consistent spacing between input and button */
  position: relative;
}

input {
    flex: 1;
    padding: 14px;
    font-size: 18px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: var(--bg);
    color: var(--fg);
}

button {
    padding: 14px 20px;
    font-size: 18px;
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

#results {
    margin-top: 40px;
    width: 90%;
    max-width: 700px;
    font-size: 16px;
    line-height: 1.6;
}

.input-wrapper {
  flex: 1 1 auto; /* input grows but stays inline */
  position: relative;
}

.input-inner {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.suggestions {
  position: absolute;
  top: calc(100% + 4px); /* moves it 4px below the input */
  left: 0;
  width: 100%;
  background-color: #111;
  color: #eee;
  z-index: 9999;
  border-radius: 6px; /* optional, softens edges */
  box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}



.suggestion-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.suggestion-item:hover {
    background: rgba(255,255,255,0.1);
}

.actor-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 16px;
}

.actor-bio {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    text-align: center;
}

.bio-image img {
    width: 220px;
    height: auto;
    border-radius: 12px;
}

.bio-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.actor-name {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 6px;
}

.actor-meta {
    font-size: 14px;
    color: var(--fg-muted, #aaa);
    margin-top: 6px;
    margin-bottom: 18px;
    text-align: center;
    font-weight: 400;
    opacity: 0.9;
}

.bio {
    font-size: 14px;
    opacity: 0.8;
}

.controls {
    display: flex;
    justify-content: space-between;
    margin: 20px 0;
    gap: 10px;
}

.filter-btn {
    padding: 8px 14px;
    border-radius: 6px;
    border: 1px solid var(--accent);
    background: var(--bg);
    color: var(--fg);
    cursor: pointer;
    font-size: 14px;
}

.filter-btn.active {
    background: var(--accent);
    color: var(--bg);
}

.sort-select {
    padding: 8px;
    border-radius: 6px;
    border: 1px solid var(--accent);
    background: var(--bg);
    color: var(--fg);
    font-size: 14px;
}

.filmography-title {
    text-align: center;
    font-weight: 700;
    font-size: 22px;
    margin: 30px 0 15px;
}

.filmography-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.film {
    display: grid;
    grid-template-columns: 120px 1fr;
    align-items: center;
    gap: 14px;
    position: relative;
}

.film-poster {
    width: 110px;
    height: 165px;
    object-fit: cover;
    border-radius: 8px;
    background: #222;
}

.film-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    gap: 4px;
}

.film-title {
    font-weight: 600;
    font-size: 15px;
}

.film-year {
    opacity: 0.7;
    font-size: 13px;
}

.film-character {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 2px;
}

.film-type {
    font-size: 12px;
    font-weight: bold;
    margin-top: 4px;
}

.film-type.movie { color: var(--movie); }
.film-type.tv { color: var(--tv); }

.imdb-button {
    background-color: #f5c518;
    color: #000;
    border: none;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 14px;
    font-weight: bold;
    font-family: Arial, sans-serif;
    cursor: pointer;
    margin-top: 6px;
}

#backToTop {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--accent);
    color: var(--bg);
    border: none;
    padding: 10px 16px;
    border-radius: 30px;
    font-size: 14px;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.2s;
    z-index: 999;
}

#backToTop.visible {
    opacity: 0.85;
    pointer-events: auto;
}

.confirmed-word {
    background-color: rgba(255, 255, 0, 0.4);
    border-radius: 3px;
    padding: 0 2px;
}

#toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0,0,0,0.85);
    color: #fff;
    padding: 12px 18px;
    border-radius: 6px;
    font-size: 15px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: translateY(-10px);
    z-index: 9999;
}

#toast.show {
    opacity: 1;
    transform: translateY(0);
}

.trending-row {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #222;
}

.trending-row:hover {
    background: #1a1a1a;
}

.trending-thumb {
    width: 55px;
    height: 55px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 12px;
}

.trending-name {
    font-size: 1rem;
    color: #fff;
}



#actorInput {
    min-width: 220px;   /* prevents collapse */
    padding-right: 2.5em;   /* space for the X */
    box-sizing: border-box;
	background-color: #111;   /* dark background */
	color: #eee;              /* light text */
	border: 1px solid #444;	
}

.clear-btn {
    display: none;
    position: absolute;
    right: 0.75em;          /* stays inside input at all widths */
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    font-size: 1.2em;
    color: #ccc;
    cursor: pointer;
    line-height: 1;
}


.clear-btn:hover {
    color: #fff;
}

.search-box button {
  flex-shrink: 0; /* button keeps its size */
  width: auto;
  padding: 0.6em 1.2em;
  font-size: 1em;
}

/* Remove the mobile stacking rule entirely */
@media (max-width: 480px) {
  .search-box {
    flex-direction: row;
    align-items: center;
  }

  .search-box button {
    width: auto;
  }
}

.trending-header {
  padding: 12px 0 6px;
  font-size: 1rem;
  color: #ccc;
  text-align: left;
  letter-spacing: 0.3px;
  display: block;
}

.trending-sub {
  font-size: 0.8rem;
  color: #777;
}

@media (max-width: 768px) {
  .trending-header {
    padding: 10px 0 4px;
    font-size: 0.95rem;
  }
}

.imdb-rating {
    font-size: 0.85rem;
    color: #f5c518; /* IMDb gold */
    margin-top: 4px;
    letter-spacing: 0.3px;
}

.imdb-na {
    color: #666;
}
