/* Prevent adjustments of font size after orientation changes */
html {
    -webkit-text-size-adjust: 100%; 
    -ms-text-size-adjust: 100%;
}

/* Apply natural box layout model to all elements */
* { 
    -moz-box-sizing: border-box; 
    -webkit-box-sizing: border-box; 
    box-sizing: border-box; 
}

body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #1a1a2e;
    color: #eee;
}

header {
    background-color: #16213e;
    padding: 1rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

header h1 {
    color: #ffd700;
    margin: 0;
    font-size: 1.8rem;
    text-align: center;
    grid-column: 2;
}

header section {
    display: flex;
    gap: 1rem;
    grid-column: 3;
    justify-self: end;
}

header section img {
    width: 35px;
    height: 35px;
    cursor: pointer;
    transition: transform 0.2s;
    filter: invert(1);
}

header section img:hover {
    transform: scale(1.15);
}

main {
    padding: 1rem;
}

/* poster cards mobile */
body.showGrid #cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

body.showGrid .movie-card {
    background-color: #0f3460;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

body.showGrid .movie-title {
    color: #ffd700;
    margin: 0;
    padding: 0.8rem;
    font-size: 1.1rem;
    background-color: #0f3460;
    text-align: center;
}

body.showGrid .poster-image {
    width: 100%;
    height: auto;
    display: block;
}

body.showGrid .card-content {
    padding: 0.8rem;
}

body.showGrid .movie-info {
    margin: 0.4rem 0;
    line-height: 1.4;
    font-size: 0.85rem;
}

/* poster cards */
body.showMenu #cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 700px;
    margin: 0 auto;
}

body.showMenu .movie-card {
    background-color: #0f3460;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    display: grid;
    grid-template-columns: 100px 1fr;
    grid-template-rows: auto 1fr;
    gap: 0 1rem;
}

body.showMenu .movie-title {
    color: #ffd700;
    margin: 0;
    padding: 1rem;
    font-size: 1.3rem;
    background-color: #0a2342;
    grid-column: 1 / 3;
    grid-row: 1;
}

body.showMenu .movie-card > img {
    grid-column: 1;
    grid-row: 2;
    width: 100px;
    height: auto;
    padding: 1rem 0 1rem 1rem;
}

body.showMenu .card-content {
    grid-column: 2;
    grid-row: 2;
    padding: 1rem 1rem 1rem 0;
}

body.showMenu .movie-info {
    margin: 0.3rem 0;
    line-height: 1.4;
    font-size: 0.85rem;
}

/* Toggle button */
body.showMenu #menu {display: none;}
body.showMenu #grid {display: block;}
body.showGrid #menu {display: block;}
body.showGrid #grid {display: none;}

footer {
    background-color: #16213e;
    text-align: center;
    padding: 2rem;
    margin-top: 2rem;
    color: #aaa;
}

footer p {
    margin: 0;
}