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

body {
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
  background: linear-gradient(145deg, #0c0d11, #181b23);
  color: #e0e0e0;
  min-height: 100vh;
  text-align: center;
  overflow-x: hidden;
}

header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  padding: 50px 20px;
  backdrop-filter: blur(10px);
  background: rgba(20,20,25,0.85);
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
  border-bottom: 1px solid #333;
}

.atomlogo-container {
  display: flex;
  align-items: center;
  gap: 20px;
}

.atomlogo {
  width: 70px;
  height: 70px;
  object-fit: contain;
  animation: spin 3s linear infinite;
  transition: transform 0.3s ease;
  will-change: transform;
}

.atomlogo:hover {
  transform: rotate(5deg) scale(1.05);
}

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

h1 {
  font-size: 2.8em;
  color: #5ac8fa;
  font-weight: 700;
}

h2 {
  font-weight: 400;
  font-size: 1.3em;
  color: #c0c0c0;
  min-height: 1.5em;
  position: relative;
}

#random-phrase::after {
  content: '|';
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

nav {
  display: flex;
  justify-content: center;
  gap: 25px;
  background: #16171b;
  padding: 14px;
  box-shadow: inset 0 -1px 0 #222;
  flex-wrap: wrap;
}

nav a {
  color: #e0e0e0;
  text-decoration: none;
  font-weight: 500;
  font-size: 1.05em;
  padding: 10px 18px;
  border-radius: 10px;
  transition: all 0.3s ease;
  will-change: transform;
}

nav a:hover {
  background: #5ac8fa33;
  color: #5ac8fa;
  box-shadow: 0 0 12px #5ac8fa44;
  transform: translateY(-2px);
}

.content {
  padding: 40px 20px;
  max-width: 1400px;
  margin: 0 auto;
}

.controls {
  margin-bottom: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

#search-input {
  padding: 10px 14px;
  font-size: 1em;
  border-radius: 10px;
  border: 1px solid #333;
  background: #1a1c22;
  color: #e0e0e0;
  outline: none;
  margin: 20px 10px 20px 0;
  transition: border 0.3s, box-shadow 0.3s;
  min-width: 250px;
}

#search-input:focus {
  border-color: #5ac8fa;
  box-shadow: 0 0 8px #5ac8fa55;
}

#result-count {
  color: #5ac8fa;
  font-weight: 500;
}

.filters {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.filters button {
  color: #e0e0e0;
  text-decoration: none;
  font-weight: 500;
  font-size: 1.05em;
  padding: 10px 18px;
  border-radius: 10px;
  transition: all 0.3s ease;
  background: #16171b;
  border: 1px solid #2b2b2b;
  margin: 5px;
  cursor: pointer;
  will-change: transform;
}

.filters button.active,
.filters button:hover {
  transform: scale(1.05);
  background: #5ac8fa33;
  color: #5ac8fa;
  box-shadow: 0 0 12px #5ac7fa34;
  border-color: #5ac8fa;
}

#movie-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px,1fr));
  gap: 18px;
  justify-content: center;
  margin-top: 30px;
}

.movie {
  background: #1a1c22;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  padding: 16px;
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  will-change: transform;
}

.movie:hover {
  transform: translateY(-5px) scale(1.03);
  box-shadow: 0 8px 25px rgba(0,0,0,0.5);
  background: #272a33;
}

.movie img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 12px;
}

.movie h3 {
  color: #5ac8fa;
  margin-bottom: 6px;
}

.movie .year {
  font-size: 0.95em;
  color: #ccc;
  margin-bottom: 8px;
}

.read-more-content {
  font-size: 0.9em;
  color: #ccc;
  text-align: center;
  max-height: 60px;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.read-more-content.expanded {
  max-height: 500px;
}

.read-more-toggle {
  display: block;
  font-size: 0.85em;
  color: #5ac8fa;
  cursor: pointer;
  margin-top: 5px;
  transition: color 0.2s;
}

.read-more-toggle:hover {
  color: #49b7d6;
}

.links {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.links a {
  color: #e0e0e0;
  text-decoration: none;
  font-weight: 500;
  font-size: 1.05em;
  padding: 10px 18px;
  border-radius: 10px;
  transition: all 0.3s ease;
  background: #16171b;
  border: 1px solid #2b2b2b;
  margin: 5px;
  will-change: transform;
}

.links a:hover {
  background: #49b7d6;
  border-color: #317c91;
  transform: translateY(-2px);
}

@media (max-width: 700px) {
  h1 { font-size: 2.2em; }
  h2 { font-size: 1.1em; }
  #movie-list { gap: 14px; }
  .movie img { height: 120px; }
}
