:root {
    --primary-color: #2196f3;
    --background-color: #ffffff;
    --text-color: #333333;
    --card-background: #f5f5f5;
    --modal-background: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

.dark-mode {
    --primary-color: #64b5f6;
    --background-color: #1a1a1a;
    --text-color: #ffffff;
    --card-background: #2d2d2d;
    --modal-background: #333333;
    --shadow-color: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.search-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

#searchInput {
    width: 100%;
    max-width: 500px;
    padding: 12px;
    border: 2px solid var(--primary-color);
    border-radius: 25px;
    font-size: 16px;
    background-color: var(--background-color);
    color: var(--text-color);
}

#searchButton {
    padding: 12px 24px;
    background-color: var(--primary-color);
    border: none;
    border-radius: 25px;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s;
}

#searchButton:hover {
    background-color: #1976d2;
}

nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.nav-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 16px;
    position: relative;
}

.nav-btn.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px;
}

.movie-card {
    background-color: var(--card-background);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s;
    cursor: pointer;
    box-shadow: 0 4px 6px var(--shadow-color);
    position: relative;
}

.movie-card:hover {
    transform: translateY(-5px);
}

.movie-card-inner {
    position: relative;
}

.quick-watchlist-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    color: white;
    font-size: 16px;
    transition: all 0.3s ease;
    z-index: 2;
}

.quick-watchlist-btn:hover {
    transform: scale(1.1);
    background: rgba(0, 0, 0, 0.9);
}

.quick-watchlist-btn.in-watchlist {
    background: var(--primary-color);
}

.movie-poster {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.movie-info {
    padding: 15px;
}

.movie-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 8px;
}

.movie-year {
    color: #666;
    font-size: 14px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
}

.modal-content {
    position: relative;
    background-color: var(--modal-background);
    margin: 5% auto;
    padding: 20px;
    width: 90%;
    max-width: 800px;
    border-radius: 10px;
    max-height: 90vh;
    overflow-y: auto;
}

.close {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-color);
}

.hidden {
    display: none;
}

.toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary-color);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: bottom 0.3s ease-in-out;
    z-index: 1000;
}

.toast.show {
    bottom: 20px;
}

.empty-watchlist {
    text-align: center;
    padding: 40px;
    color: var(--text-color);
}

.empty-watchlist i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.empty-watchlist .subtitle {
    color: #666;
    margin-top: 10px;
}

/* Hover effect for movie cards */
.movie-card-inner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.8) 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.movie-card:hover .movie-card-inner::after {
    opacity: 1;
}

/* Theme Switch Styles */
.theme-switch {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Movie Details Styles */
.movie-details {
    display: flex;
    gap: 20px;
    padding: 20px;
}

.movie-details img {
    max-width: 300px;
    border-radius: 10px;
}

.movie-details-info {
    flex: 1;
}

.movie-details-info h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.movie-details-info p {
    margin-bottom: 10px;
    line-height: 1.6;
}

.watchlist-btn {
    margin-top: 20px;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.watchlist-btn:hover {
    background-color: #1976d2;
}

.rating {
    display: inline-block;
    padding: 5px 10px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 15px;
    font-size: 14px;
    margin-right: 10px;
}
