html,body{
    padding: 0;
    margin: 0;
}
:root {
    --bg: white;
    --text: black;
    --text-muted: #616161;
    --text-light: #9E9E9E;
    --border: #D2D5DA;
    --search-bg: white;
    --btn-bg: #f9fafb;
    --divider: black;
}


body{
    font-family: 'Roboto', sans-serif;
    letter-spacing: normal;
    background-color: var(--bg);
    color: var(--text);
}

body.dark {
    --bg: #121212;        
    --text: #ffffff;
    --text-muted: #b3b3b3;
    --text-light: #757575;
    --border: #2c2c2c;
    --search-bg: #1e1e1e;
    --btn-bg: #2c2c2c;
    --divider: #2c2c2c;
}

body.dark .main {
    background-color: #121212;
}

body.dark .top-bar {
    background-color: #1e1e1e;
    border-color: #2c2c2c;
}

body.dark .search-bar input {
    color: #b3b3b3;
    background-color: #1e1e1e;
}

body.dark .top-bar button {
    color: #ffffff;
}

.container{
    width: 70%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: auto;
}

.header{
    height: 30vh;
    width: 100%;
    color: whitesmoke;
    display: flex;
    align-items: center;
    padding: 0 40px;
    overflow: hidden;
    object-position: center;
    position: relative;
}

.header img{
    filter: brightness(40%);
    width: 100%;
    height: 100%;
    position: absolute;
    z-index: 1;
    object-fit: cover;
    object-position: center;
    inset: 0;
}

.header .nav{
    z-index: 2;
    position: relative;
    color: white;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.nav a:hover {
    text-decoration: underline;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

#theme-toggle {
    background: transparent;
    border: 1px solid white;
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
}

h1{
    font-size:2.5rem ;
    font-weight: 700;
    z-index: 1000;
}

.top-bar{
    font-size: 0.8rem;
    width: 90%;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--search-bg);
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 0 ;
    position: relative;
    z-index: 10;
    margin-top: -35px;
    overflow: hidden;
    margin-bottom: 20px;
}

.search-bar{
    display: flex;
   align-items: center;
   flex: 1;
   gap: 10px;
   padding: 0 15px;
   background-color: var(--search-bg);
}

.search-bar input{
    height: 55px;
    border: none;
    outline: none;
    flex: 1;
    font-size: 1rem;
    cursor: pointer;
    background-color: var(--search-bg);
    color: var(--text-light);
}

.search-bar input:focus {
    outline: none;
    background-color: var(--search-bg);
}

.top-bar button{
    height: 59px;
    padding: 0 80px;
    white-space: nowrap;
    background-color: var(--btn-bg);
    border: none;
    font-size: 1rem;
    cursor: pointer;
    border-left: 2px solid var(--border);;
    border-color: var(--border);
    color: var(--text);
}

.search-bar i{
    color: #BDBDBD
}


.main{
    background-color: var(--bg);
    display: flex;
    width: 100%;
    min-height: 60vh;
    justify-content: center;
    align-items: center;
    border: none;
}

.content{
    display: flex;
    flex-direction: column;
    color: var(--text-light);
    gap: 30px;
    width: 100%;
    justify-content: center;
    align-items: center;
}

.content img{
    width: 80px;
    height: 80px;
}

.content.has-result{
    justify-content: flex-start;
    align-items: flex-start;
    padding: 20px 0;
}


.movie-info {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 30px;
    padding: 20px 20px 20px 60px; /* move the left offset here as padding */
    width: 100%;            
    box-sizing: border-box;
    border-bottom: none; 
    position: relative;
    margin-top: -10px;
}

.movie-info::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 60px;           /* aligns with poster's left edge */
    right: 60px;          
    height: 1px;
    background-color: var(--divider);
}


.movie-info img{
    width: 150px;
    height: 220px;
    object-fit: cover;
    flex-shrink: 0;
    cursor: pointer;
}

.movie-detail{
    display: flex;
    flex-direction: column;
    color: var(--text);
    gap: 8px;
}

.movie-detail  img{
    width: 20px;
    height: 20px;
}

.movie-detail .fa-circle-plus {
    font-size: 1rem;
    color: var(--text);
    cursor: pointer;
}

.movie-detail h2 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: normal;
    margin: 0 0 4px 0;
}

.movie-heading p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin: 0 0 8px 0;
}

.movie-heading span {
    font-size: 0.9rem;
    margin-right: 12px;
}

.movie-main{
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 8px 0;
}

.movie-main p {
    margin: 0;
}

.movie-detail > p { 
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-top: 12px;
    max-width: 600px;
}

.empty-watchlist{
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.empty-watchlist a{
    text-decoration: none;
    color: var(--text-muted);
}

.movie-info-collected:nth-of-type(1){
   margin-top: 20px;
}

.fa-circle-minus{
    cursor: pointer;
}

/* Tablet - 768px and below */
@media (max-width: 768px) {
    .container {
        width: 90%;
    }

    h1 {
        font-size: 1.8rem;
    }

    .top-bar {
        width: 100%;
    }

    .top-bar button {
        padding: 0 30px;
    }

    .movie-info {
        padding: 20px;
        gap: 20px;
    }

    .movie-info::after {
        left: 20px;
        right: 20px;
    }

    .movie-info img {
        width: 100px;
        height: 150px;
    }

    .movie-detail h2 {
        font-size: 1.1rem;
    }

    .movie-main {
        flex-wrap: wrap;
        gap: 10px;
    }
}

/* Mobile - 480px and below */
@media (max-width: 480px) {
    .container {
        width: 100%;
        margin-left: 15px;
    }

    .header {
        padding: 0px 20px;
    }

    h1 {
        font-size: 1.4rem;
    }

    .top-bar {
        width: 95%;
        margin-top: -25px;
    }

    .top-bar button {
        padding: 0 15px;
        font-size: 0.85rem;
    }

    .movie-info {
        flex-direction: column;  
        align-items: flex-start;
        padding: 15px;
        gap: 15px;
    }

    .movie-info::after {
        left: 15px;
        right: 15px;
    }

    .movie-info img {
        width: 100%;
        height: 200px;
        object-fit: cover;
        object-position: top;
    }

    .movie-detail > p {
        max-width: 100%;
    }

    .movie-heading span {
        display: inline-block;
        margin-bottom: 4px;
    }

    .empty-watchlist {
        padding: 20px;
        text-align: center;
    }

    .empty-watchlist h2 {
        font-size: 1rem;
    }
}