@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg-color: #0f111a;
  --bg-gradient: linear-gradient(135deg, #0f111a 0%, #1a1b2e 100%);
  --primary-color: #6366f1;
  --primary-hover: #4f46e5;
  --secondary-color: #ec4899;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --danger: #ef4444;
  --success: #10b981;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
}

body {
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-glow {
  0% { box-shadow: 0 0 15px rgba(99, 102, 241, 0.3); }
  50% { box-shadow: 0 0 25px rgba(236, 72, 153, 0.5); }
  100% { box-shadow: 0 0 15px rgba(99, 102, 241, 0.3); }
}

/* Base Glass Container */
.glass-container {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.6s ease-out;
}

/* Typography */
h1, h2, h3 {
  font-weight: 700;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.5rem;
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

p {
  color: var(--text-muted);
  line-height: 1.6;
}

/* Form Elements */
input {
  width: 100%;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: white;
  font-size: 1rem;
  transition: all 0.3s ease;
}

input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

button {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -10px var(--primary-color);
}

button.danger {
  background: linear-gradient(135deg, var(--danger), #b91c1c);
}

button.danger:hover {
  box-shadow: 0 10px 20px -10px var(--danger);
}

.alert {
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  text-align: center;
}

.alert.error {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert.success {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Layouts */
.center-screen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.login-wrapper {
  max-width: 400px;
  width: 100%;
  text-align: center;
}

/* App Main */
.app-header {
  padding: 2rem 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(15, 17, 26, 0.8);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-main {
  padding: 4rem 5%;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Autocomplete Search Bar */
.search-container {
  position: relative;
  max-width: 800px;
  margin: 2rem auto;
}

.search-input-wrapper {
  position: relative;
}

#searchInput {
  padding: 1.5rem 2rem;
  font-size: 1.25rem;
  border-radius: 20px;
  animation: pulse-glow 4s infinite alternate;
  margin-bottom: 0;
}

.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0.5rem;
  background: var(--bg-color);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  z-index: 50;
  max-height: 400px;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);
  display: none;
}

.autocomplete-dropdown.active {
  display: block;
}

.movie-result {
  display: flex;
  align-items: center;
  padding: 1rem;
  cursor: pointer;
  transition: background 0.2s ease;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.movie-result:last-child {
  border-bottom: none;
}

.movie-result:hover {
  background: var(--glass-bg);
}

.movie-poster {
  width: 50px;
  height: 75px;
  object-fit: cover;
  border-radius: 8px;
  margin-right: 1.5rem;
  background: #2a2c3a;
}

.movie-info {
  flex: 1;
}

.movie-title {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.movie-year {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.btn-request {
  width: auto;
  padding: 0.5rem 1.5rem;
  font-size: 0.9rem;
  background: linear-gradient(135deg, var(--secondary-color), #be185d);
}

/* Admin Dashboard */
.admin-dashboard {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

@media (max-width: 900px) {
  .admin-dashboard {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: var(--glass-bg);
  border-radius: 20px;
  padding: 2rem;
  border: 1px solid var(--glass-border);
}

.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--glass-border);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--glass-border);
}

th {
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: var(--bg-color);
  width: 100%;
  max-width: 450px;
}

/* Action forms in list */
.inline-form {
  display: inline;
}
.inline-form button {
  width: auto;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  margin: 0;
  display: inline-block;
}
