/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #fafafa;
    min-height: 100vh;
    color: #222;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== APP CONTAINER ===== */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== HEADER ===== */
.header {
    padding: 2rem 0;
    text-align: center;
    background: #111;
    position: relative;
    overflow: hidden;
    color: #fff;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.logo i {
    font-size: 3rem;
    color: #e53935;
}

.logo h1 {
    font-size: 3rem;
    font-weight: 800;
    color: #fff;
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    background-clip: unset;
}

.tagline {
    font-size: 1.2rem;
    color: #e53935;
    font-weight: 400;
    position: relative;
    z-index: 1;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem 2rem;
    width: 100%;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 32px rgba(0,0,0,0.04);
}

/* ===== SEARCH SECTIONS ===== */
.search-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 2.5rem;
    margin-bottom: 2rem;

}

.section-container h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem;
    text-align: center;
}

.section-container p {
    text-align: center;
    color: #666;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* ===== MOOD SEARCH ===== */
.mood-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
}

#moodInput {
    width: 100%;
    padding: 1.5rem;
    border: 2px solid #e1e5e9;
    border-radius: 15px;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    min-height: 100px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

#moodInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: white;
}

/* ===== SEARCH DIVIDER ===== */
.search-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    width: 100%;
}

.search-divider::before,
.search-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e1e5e9;
}

.search-divider span {
    padding: 0 1rem;
    color: #666;
    font-weight: 500;
    font-size: 0.9rem;
}

/* ===== NAME SEARCH ===== */
.name-search-wrapper {
    display: flex;
    gap: 1rem;
    width: 100%;
    max-width: 600px;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: white;
}

.name-search-wrapper .btn {
    min-width: auto;
    padding: 1rem 1.5rem;
}

/* ===== GENRE SEARCH ===== */
.genres-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.genre-tag {
    background: #fff;
    border: 2px solid #e53935;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    user-select: none;
    color: #e53935;
    transition: all 0.3s ease;
}

.genre-tag:hover, .genre-tag.selected {
    background: #e53935;
    color: #fff;
    border-color: #e53935;
    box-shadow: 0 8px 20px rgba(229,57,53,0.12);
}

.search-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== BUTTONS ===== */
.btn, #watch-movie-btn {
    background: #e53935;
    color: #fff;
    border: none;
    border-radius: 25px;
    padding: 12px 32px;
    font-size: 1.1rem;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(229,57,53,0.12);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
    outline: none;
    margin-top: 10px;
}

.btn:hover, #watch-movie-btn:hover {
    background: #b71c1c;
    color: #fff;
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 4px 16px rgba(229,57,53,0.18);
}

.btn-secondary {
    background: #fff;
    color: #e53935;
    border: 2px solid #e53935;
}

.btn-secondary:hover {
    background: #e53935;
    color: #fff;
}

.btn-success {
    background: #111;
    color: #fff;
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.1);
}

.btn-success:hover {
    background: #e53935;
    color: #fff;
}

/* Button loading spinner */
.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}
.btn-loading .btn-spinner {
  display: inline-block;
  width: 1.2em;
  height: 1.2em;
  border: 2.5px solid #fff;
  border-top: 2.5px solid #e53935;
  border-radius: 50%;
  animation: spinBtn 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 0.5em;
}
@keyframes spinBtn {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ===== RESULTS SECTION ===== */
.results-section {
    display: none;
    background: #fff;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.04);
    border: 1px solid #eee;
}

.results-header {
    text-align: center;
    margin-bottom: 2rem;
}

.results-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem;
}

.results-header p {
    color: #666;
    font-size: 1.1rem;
}

/* ===== MOVIES CONTAINER ===== */
.movies-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
}

/* ===== MOVIE CARDS ===== */
.movie-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #eee;
    flex: 0 0 300px;
    max-width: 300px;
    animation: slideFadeIn 0.7s cubic-bezier(0.23, 1, 0.32, 1) forwards;
    opacity: 0;
}

.movie-card:hover {
    box-shadow: 0 25px 50px rgba(229,57,53,0.12);
    border-color: #e53935;
}

.movie-poster {
    position: relative;
    height: 250px;
    background: #111;
    overflow: hidden;
}

.movie-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.movie-card:hover .movie-poster img {
    transform: scale(1.05);
}

.movie-poster-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: black;
    color: #fff;
    font-size: 3rem;
}

.movie-rating {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #e53935;
    color: white;
    padding: 8px 12px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
}

.movie-info {
    padding: 1.5rem;
}

.movie-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #111;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.movie-year {
    color: #e53935;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.movie-description {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.movie-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.movie-genre {
    background: #fff0f0;
    color: #e53935;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ===== LOADING ===== */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(229,57,53, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.loading-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 3rem;
    text-align: center;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e1e5e9;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

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

.loading-content p {
    color: #666;
    font-size: 1.1rem;
    font-weight: 500;
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
}

.modal-content {
    position: relative;
    background: #fff;
    margin: 5% auto;
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: modalDropIn 0.45s cubic-bezier(0.23, 1, 0.32, 1);
    color: #111;
}

.modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    background: #e53935;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2001;
    transition: all 0.3s ease;
    color: #fff;
    font-size: 1.2rem;
}

.modal-close:hover {
    background: #b71c1c;
    color: #fff;
    transform: scale(1.1);
}

.modal-body {
    padding: 2.5rem;
}

.modal-movie-header {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    align-items: flex-start;
}

.modal-poster {
    width: 200px;
    height: 300px;
    border-radius: 15px;
    overflow: hidden;
    flex-shrink: 0;
    background: #111;
}

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

.modal-poster-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: black;
    color: #fff;
    font-size: 4rem;
}

.modal-movie-info h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.modal-movie-meta {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.modal-rating {
    margin-bottom: 1.5rem;
}

.rating-stars {
    color: #ffc107;
    font-size: 1.5rem;
    letter-spacing: 3px;
}

.modal-description {
    color: #666;
    line-height: 1.7;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.modal-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.modal-genre {
    background: #fff0f0;
    color: #e53935;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .header-content,
    .main-content {
        padding: 0 0.5rem;
    }
    .search-section {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    .logo h1 {
        font-size: 2rem;
    }
    .logo i {
        font-size: 2rem;
    }
    .section-container h2 {
        font-size: 1.3rem;
    }
    .section-container p {
        font-size: 1rem;
    }
    .genres-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    .genre-tag {
        padding: 0.7rem;
        font-size: 0.95rem;
    }
    .search-actions {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    .btn, #watch-movie-btn {
        width: 100%;
        max-width: 250px;
        font-size: 1rem;
        padding: 12px 0;
    }
    .movies-container {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    .movie-card {
        max-width: 100%;
        width: 100%;
        min-width: 0;
    }
    .movie-poster {
        height: 180px;
    }
    .movie-title {
        font-size: 1.1rem;
    }
    .modal-content {
        width: 98%;
        margin: 2% auto;
        padding: 0.5rem;
    }
    .modal-body {
        padding: 1rem;
    }
    .modal-movie-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    .modal-poster {
        width: 100%;
        height: 180px;
        align-self: center;
    }
    .modal-movie-info h2 {
        font-size: 1.3rem;
    }
    .modal-genre {
        font-size: 0.85rem;
        padding: 6px 10px;
    }
    .loading-content {
        padding: 1.5rem;
    }
}

@media (max-width: 600px) {
  .main-content {
    padding: 0 0.2rem 1rem;
    border-radius: 0;
    box-shadow: none;
  }
  .results-section {
    padding: 1rem 0.2rem;
    border-radius: 0;
    box-shadow: none;
  }
  .movies-container {
    gap: 0.7rem;
  }
  .movie-card {
    max-width: 100%;
    width: 100%;
    min-width: 0;
    border-radius: 12px;
    padding: 0.5rem 0.2rem;
  }
  .movie-poster {
    height: 120px;
    border-radius: 10px;
  }
  .movie-title {
    font-size: 1rem;
  }
  .movie-description {
    font-size: 0.9rem;
  }
  .movie-rating {
    font-size: 0.8rem;
    padding: 5px 8px;
    border-radius: 8px;
    top: 8px;
    right: 8px;
  }
  .modal-content {
    width: 99vw;
    max-width: 99vw;
    margin: 0;
    border-radius: 0 0 16px 16px;
    padding: 0.2rem;
  }
  .modal-body {
    padding: 0.7rem;
  }
  .modal-movie-header {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
  .modal-poster {
    width: 100%;
    height: 120px;
    border-radius: 10px;
    align-self: center;
  }
  .modal-movie-info h2 {
    font-size: 1.1rem;
  }
  .modal-movie-meta {
    font-size: 0.95rem;
  }
  .modal-description {
    font-size: 0.95rem;
    margin-bottom: 0.7rem;
  }
  .modal-genre {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 7px;
  }
  .modal-close {
    width: 32px;
    height: 32px;
    font-size: 1rem;
    right: 8px;
    top: 8px;
  }
  .btn, #watch-movie-btn {
    width: 100%;
    max-width: 180px;
    font-size: 0.95rem;
    padding: 10px 0;
    border-radius: 18px;
  }
  .btn-secondary, .btn-success {
    font-size: 0.95rem;
    padding: 10px 0;
    border-radius: 18px;
  }
  .name-search-wrapper {
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    max-width: 100%;
  }
  .search-input {
    font-size: 0.95rem;
    padding: 0.7rem 1rem;
    border-radius: 8px;
  }
  .genres-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.3rem;
  }
  .genre-tag {
    padding: 0.5rem 0.2rem;
    font-size: 0.8rem;
    border-radius: 8px;
    margin: 0.1rem 0;
  }
  .search-actions {
    gap: 0.3rem;
  }
  .loading-content {
    padding: 1rem;
  }
}

/* ===== ANIMATIONS (NEW) ===== */
@keyframes slideFadeIn {
    from { opacity: 0; transform: translateY(40px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes modalDropIn {
    from { opacity: 0; transform: translateY(-60px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(102,126,234,0.18); }
    70% { box-shadow: 0 0 0 10px rgba(102,126,234,0.08); }
    100% { box-shadow: 0 0 0 0 rgba(102,126,234,0.18); }
}

/* Movie card slide-fade in with stagger */
.movies-container .movie-card {
    animation-delay: calc(var(--card-index, 0) * 60ms);
}

/* Modal drop-in */
.modal-content {
    animation: modalDropIn 0.45s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Button gentle pulse on hover */
.btn:hover, #watch-movie-btn:hover {
    animation: pulse 0.7s;
}

/* Remove previous shimmer and pop/rotate */
.movie-poster img:hover {
    filter: brightness(1.04);
    transition: filter 0.3s;
}

/* Load More button base style */
.load-more-btn {
  display: block;
  margin: 24px auto 0 auto;
  width: 160px;
  height: 40px;
  font-size: 0.98rem;
  padding: 10px 0;
  border-radius: 18px;
  background: #e53935;
  color: #fff;
  font-weight: bold;
  border: none;
  box-shadow: 0 2px 8px rgba(229,57,53,0.12);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  text-align: center;
}
.load-more-btn:hover {
  background: #b71c1c;
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 4px 16px rgba(229,57,53,0.18);
}

@media (max-width: 600px) {
  .load-more-btn {
    width: 160px;
    font-size: 0.95rem;
    padding: 10px 0;
    border-radius: 14px;
    margin: 14px auto 0 auto;
  }
} 