/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
}

a {
  color: #0066cc;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Header styles */
header {
  background-color: #1a1a2e;
  color: white;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.logo h1 {
  font-size: 24px;
  margin: 0;
}

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

nav ul li {
  margin-left: 20px;
}

nav ul li a {
  color: white;
  text-decoration: none;
}

nav ul li a:hover {
  text-decoration: underline;
}

.search-container {
  margin-top: 10px;
  width: 100%;
}

.search-container form {
  display: flex;
}

.search-container input {
  padding: 8px;
  border: none;
  border-radius: 4px 0 0 4px;
  width: 300px;
}

.search-container button {
  padding: 8px 15px;
  background-color: #0066cc;
  color: white;
  border: none;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
}

/* Main content */
main {
  min-height: calc(100vh - 150px);
}

h2 {
  margin-bottom: 20px;
  color: #1a1a2e;
}

/* Search Section */
.search-section {
  margin-bottom: 30px;
  text-align: center;
}

.search-form {
  margin: 20px 0;
}

.search-input-group {
  display: flex;
  justify-content: center;
  max-width: 600px;
  margin: 0 auto;
}

.search-input {
  flex: 1;
  padding: 12px 15px;
  border: 2px solid #ddd;
  border-radius: 25px 0 0 25px;
  font-size: 16px;
  outline: none;
}

.search-input:focus {
  border-color: #0066cc;
}

.search-btn {
  padding: 12px 20px;
  background-color: #0066cc;
  color: white;
  border: none;
  border-radius: 0 25px 25px 0;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.3s;
}

.search-btn:hover {
  background-color: #0052a3;
}

.search-info {
  margin-top: 15px;
  color: #666;
}

.clear-search {
  color: #0066cc;
  margin-left: 10px;
}

/* Movie cards */
.movies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

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

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

.movie-content {
  flex: 1;
  font-family: "Segoe UI", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 15px;
}

.movie-footer {
  border-top: 1px solid #eee;
  padding-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer {
    background-color: var(--primary-color);
    color: white;
    padding: 25px 0;
    margin-top: 50px;
}

.movie-meta {
  color: #666;
  font-size: 12px;
}

.movie-actions {
  display: flex;
  gap: 8px;
}

/* No results */
.no-results {
  text-align: center;
  padding: 40px 20px;
  color: #666;
  grid-column: 1 / -1;
}

.no-results h3 {
  margin-bottom: 10px;
  color: #333;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  margin-top: 30px;
  gap: 5px;
  flex-wrap: wrap;
}

.pagination-btn {
  padding: 8px 12px;
  background-color: white;
  border: 1px solid #ddd;
  color: #0066cc;
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.3s;
}

.pagination-btn:hover,
.pagination-btn.active {
  background-color: #0066cc;
  color: white;
  text-decoration: none;
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s;
}

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

.modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 20px;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  position: relative;
  animation: slideIn 0.3s;
  max-height: 80vh;
  overflow-y: auto;
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  position: absolute;
  right: 15px;
  top: 10px;
  z-index: 1001;
}

.close:hover,
.close:focus {
  color: #000;
  text-decoration: none;
}

/* Share buttons */
.share-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin: 20px 0;
}

.share-btn {
  padding: 10px 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  color: white;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: opacity 0.3s;
}

.share-btn.facebook {
  background-color: #1877f2;
}
.share-btn.twitter {
  background-color: #1da1f2;
}
.share-btn.whatsapp {
  background-color: #25d366;
}
.share-btn.telegram {
  background-color: #0088cc;
}
.share-btn.copy {
  background-color: #6c757d;
}

.share-btn:hover {
  opacity: 0.8;
  text-decoration: none;
  color: white;
}

.share-link {
  margin-top: 15px;
}

.share-link label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

.share-link input {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

/* Notification */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: #28a745;
  color: white;
  padding: 15px 20px;
  border-radius: 4px;
  z-index: 1001;
  display: none;
  animation: slideInRight 0.3s;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Login page */
.login-container {
  max-width: 500px;
  margin: 100px auto;
  text-align: center;
}

.login-box {
  background-color: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-top: 20px;
}

.google-login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: white;
  color: #333;
  border: 1px solid #ddd;
  padding: 10px 15px;
  border-radius: 4px;
  margin: 20px auto;
  width: 220px;
  transition: background-color 0.3s;
}

.google-login-btn:hover {
  background-color: #f5f5f5;
  text-decoration: none;
}

.google-login-btn svg {
  margin-right: 10px;
}

/* Login info section */
.login-info {
  margin-top: 30px;
  text-align: left;
  background-color: #f8f9fa;
  padding: 25px;
  border-radius: 8px;
  border-left: 4px solid #0066cc;
}

.login-info h3 {
  color: #0066cc;
  margin-bottom: 15px;
  font-size: 18px;
}

.login-info ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.login-info li {
  margin: 12px 0;
  color: #555;
  padding-left: 25px;
  position: relative;
  line-height: 1.5;
}

.login-info li:before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #28a745;
  font-weight: bold;
  font-size: 16px;
}

.login-info p {
  margin: 15px 0;
  color: #666;
  line-height: 1.6;
}

.guest-access {
  margin-top: 30px;
  padding: 20px;
  background-color: #fff3cd;
  border-radius: 8px;
  border-left: 4px solid #ffc107;
  text-align: left;
}

.guest-access h4 {
  color: #856404;
  margin-bottom: 10px;
  font-size: 16px;
}

.guest-access p {
  color: #856404;
  margin: 8px 0;
  line-height: 1.5;
}

.guest-access a {
  color: #0066cc;
  font-weight: 500;
}

.guest-access a:hover {
  text-decoration: underline;
}

/* Forms */
.form-group {
  margin-bottom: 15px;
  text-align: left;
}

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

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: inherit;
  font-size: 16px;
}

.modal-buttons {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  justify-content: flex-end;
}

.btn {
  display: inline-block;
  background-color: #0066cc;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.3s;
  text-decoration: none;
}

.btn:hover {
  background-color: #0052a3;
  text-decoration: none;
  color: white;
}

.btn-small {
  padding: 6px 12px;
  font-size: 14px;
}

.btn-secondary {
  background-color: #6c757d;
}

.btn-secondary:hover {
  background-color: #5a6268;
}

.btn-danger {
  background-color: #dc3545;
}

.btn-danger:hover {
  background-color: #c82333;
}

.btn-back {
  background-color: #666;
}

.btn-back:hover {
  background-color: #555;
}

/* Messages */
.success-message,
.error-message {
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 20px;
}

.success-message {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.error-message {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* CTA Box */
.cta-box {
  background-color: #e6f2ff;
  padding: 20px;
  border-radius: 8px;
  margin-top: 30px;
  text-align: center;
}

.cta-box h3 {
  color: #0066cc;
  margin-bottom: 10px;
}

/* Responsive design */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: flex-start;
  }

  nav ul {
    margin-top: 10px;
    flex-wrap: wrap;
  }

  nav ul li {
    margin: 5px 15px 5px 0;
  }

  .search-container input {
    width: 100%;
  }

  .search-input-group {
    flex-direction: column;
  }

  .search-input {
    border-radius: 4px;
    margin-bottom: 10px;
  }

  .search-btn {
    border-radius: 4px;
  }

  .movies-grid {
    grid-template-columns: 1fr;
  }

  .movie-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .movie-actions {
    width: 100%;
    justify-content: space-between;
  }

  .share-buttons {
    grid-template-columns: 1fr;
  }

  .modal-content {
    width: 95%;
    margin: 10% auto;
  }

  .pagination {
    justify-content: center;
  }

  .modal-buttons {
    flex-direction: column;
  }

  .login-container {
    margin: 50px auto;
    padding: 0 15px;
  }

  .login-info {
    padding: 20px;
  }

  .guest-access {
    padding: 15px;
  }
}

/* UTF-8 emoji fix */
.movie-preview,
.movie-content {
  font-family: "Segoe UI", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
}

/* Ensure proper text encoding */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
