body {
    background-color: #404040ec; /*website bg colour*/
}


.header-box {
    border: 5px solid #161616; /*border*/
    padding: 30px; /*inside padding*/
    margin: 0px; /*outside margin*/
    height: 180px; /*height of box*/
    background-color: #404040ec; /*box colour*/
    text-align: center; /*text alignment*/
    background: url('images/header_image.jpg') center/cover no-repeat;
    opacity: 0.8;
}

.header-text {
    color: #ffffff; /*text color */
    font-family: 'Trebuchet MS', sans-serif; /*change font family */
    text-align: center; /*text alignment*/
    padding: 10px 20px; /*adds spacing inside the border */
    border-radius: 5px; /*rounds the edges */
    text-shadow: 3px 0 #000000, -3px 0 #000000, 0 3px #000000, 0 -3px #000000,
               1px 1px #000000, -1px -1px #000000, 1px -1px #000000, -1px 1px #000000;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /*5 columns*/
    gap: 30px; /*space between each item in grid*/
    padding: 20px;
    padding-top: 50px;
    justify-content: center; /*center items horizontally*/
    cursor: pointer; /*interactive items*/
    row-gap: 30px;
    margin: 0 auto;
    max-width: 100vw;
    width: 90%;
}
  

.grid-item {
    background-color: #dcd9d2;
    box-shadow: 2px 2px 1px rgba(0, 0, 0, 0.5);
    border: 5px solid #c6c2ba;
    border-radius: 10px;
    padding: 10px;
    max-width: 100%;
    font-family: 'Trebuchet MS', sans-serif;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    max-width: 250px;
    height: auto;
    box-sizing: border-box; /*ensures padding is included in total size */
}

.grid-item.automated {
    border: 5px solid #000000; /*test*/
}

.grid-item img {
    width: 100%; /*ensures images take up full width of grid item */
    height: auto;
}

.grid-item h3 {
    margin-top: 10px; /*space between image and text */
    font-size: 1.1rem; /*font size*/
    color: #333;
}

.grid-item:hover {
    background-color: #e0e0e0; /*darken on hoover*/
}

@media (max-width: 900px) {
    .grid-container {
        grid-template-columns: repeat(5, 1fr);
        width: 80%; /* Shrinks the total width */
        margin: 0 auto; /* centers it */
        gap: 15px
    }
    
    .grid-item {
        padding: 6px;
        max-width: 140px; /* or whatever size works best visually */
    }
}

@media (max-width: 700px) {
    .grid-container {
        grid-template-columns: repeat(4, 1fr);
        width: 10%; /* Shrinks the total width */
        max-width: 100px; /* Optional: cap it if needed */
        margin: 0 auto; /* centers it */
        gap: 10px
    }
    
    .grid-item {
        padding: 2px;
        max-width: 125px; /* or whatever size works best visually */
    }
}

@media (max-width: 525px) {
    .grid-container {
        grid-template-columns: repeat(3, 1fr);
        width: 10%; /* Shrinks the total width */
        max-width: 100px; /* Optional: cap it if needed */
        margin: 0 auto; /* centers it */
        gap: 10px
    }
    
      .grid-item {
        padding: 2px;
        max-width: 125px; /* or whatever size works best visually */
    }
}
  
@media (max-width: 400px) {
    .grid-container {
        grid-template-columns: repeat(3, 1fr);
        width: 10%; /* Shrinks the total width */
        max-width: 100px; /* Optional: cap it if needed */
        margin: 0 auto; /* centers it */
        gap: 10px
    }
    
      .grid-item {
        padding: 2px;
        max-width: 125px; /* or whatever size works best visually */
    }
}

@media (max-width: 390px) {
    .grid-container {
        grid-template-columns: repeat(3, 1fr);
        width: 5%; /* Shrinks the total width */
        max-width: 50px; /* Optional: cap it if needed */
        margin: 0 auto; /* centers it */
        gap: 5px
    }
    
      .grid-item {
        padding: 2px;
        max-width: 110px; /* or whatever size works best visually */
    }
}

@media (max-width: 350px) {
    .grid-container {
        grid-template-columns: repeat(3, 1fr);
        width: 5%; /* Shrinks the total width */
        max-width: 50px; /* Optional: cap it if needed */
        margin: 0 auto; /* centers it */
        gap: 5px
    }
    
      .grid-item {
        padding: 2px;
        max-width: 100px; /* or whatever size works best visually */
    }
}

.nav-page-box {
    border: 5px solid #161616;
    background-color: #0c0c0c34;
    margin-top: 10px;
    padding: 0.5px;
    padding-top: 10px;
    padding-bottom: 10px;
}

.nav-page-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.page-box {
    display: flex;
    gap: 100px;
    font-family: 'Trebuchet MS', sans-serif;
    letter-spacing: 0.1em;
    justify-content: center;
}

.nav-link {
    text-decoration: none;
    font-size: 18px;
    font-weight: bold;
    color: #161616;
    padding: 10px;
    border-radius: 10px;
    transition: 0.3s ease-in-out;
}

.nav-link:hover {
    background-color: #161616;
    color: white;
}

.movie-page-container {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 20px;
    position: center;
    width: 95vw;
}

.movie-page-item {
    background-color: #f0f0f0;
    padding: 5px;
    margin: 3px;
    width: 100%; /*ensures box takes full width */
    max-width: 350px;
    height: 700px;
    text-align: left;
    font-family: 'Impact', sans-serif;
    display: flex;
    flex-direction: column;
    box-sizing: border-box; /*ensures padding doesn't expand the box */
    overflow: hidden;
    
}

.movie-page-item img {
    width: 97%;
    height: 80%;        
    object-fit: cover;
    margin-bottom: 10px;
}

.movie-page-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start; 
    gap: 8px;
    padding: 0 10px;
    width: 100%; 
}

.movie-page-item h3{
    margin: 0;
    font-weight: normal;
    font-size: 1.4rem;
    letter-spacing: 0.6px;
}

.movie-page-item p {
    margin: 3px 0;
}

.movie-page-data {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-right: -50px;
}

.label {
    font-weight: normal;
    font-size: 0.9rem;
    color: #616161;
    padding-right: 2px;
    text-transform: lowercase;
}

.data {
    font-weight: normal; /*changes way text appears, can be bold*/
    font-size: 1rem;
    color: #333;
    text-transform: uppercase;
}

#dash-chart {
    flex: 1;
    max-width: 500px;
}

.chart-container {
    width: 540px;
    max-width: 100%;
    text-align: center;
    margin: 90px 0;
}

#radar-container{
    display: block;
    width: 68vw;
    text-align: center;
    padding-left: 10px;
}

#radar-container iframe{
    width: 100%;
    height: 520px;
    max-width: 100%;
}

#other-charts {
    visibility: hidden;
    transition: visibility 0.5s ease-in-out;
}

#other-charts.show-pie-charts {
    display: flex;
    justify-content: space-between;
    width: 100%;
    visibility: visible;

}

#youtube-container, 
#reddit-container {
   flex: 1;
   width: 35vw;
   margin: 0;
   padding-right: 20px;

}

#youtube-container embed, 
#reddit-container embed {
    height: 470px;
    width: 100%;
    max-width: 100%;
    object-fit: contain;
    overflow: visible; 
    white-space: normal;
}

button {
    display: block; /*ensures button takes up a block-level space */
    width: 200px; /* button width*/
    padding: 7px 5px;
    margin: 20px auto;
    background-color: #007bff; /*set button background colour */
    color: #fff; /*text color */
    font-size: 1.1rem; /*font size */
    font-family: 'Trebuchet MS', sans-serif;
    font-weight: bold; /*text bold */
    border: none; /*remove border */
    border-radius: 8px; /*rounded corners */
    cursor: pointer; /*change cursor to pointer on hover */
    transition: all 0.3s ease; /*smooth transition for hover effects */
}

button:hover {
    background-color: #0056b3; /*darken the button on hover */
    transform: scale(1.05); /*slightly scale the button when hovered */
}

.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popup-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    width: 60%;
    max-width: 900px;
    text-align: center;
    position: relative;
}

#popup-chart {
    width: 100%;
    height: 500px;
    object-fit: contain;
}

.popup-content h3 {
    margin: 0;
    font-size: 1.5rem;
    font-family: 'Trebuchet MS', sans-serif;
}

.close-btn {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 7px;
    right: 10px;
}

.close-btn:hover,
.close-btn:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.movie-page-box {
    border: 2px solid #161616; /*border*/
    padding: 2px; /*inside padding*/
    margin: 10px; /*outside margin*/
    background-color: #b8b7b7ec;
    text-align: center;
    font-family: 'Trebuchet MS', sans-serif;
}

.toggle-switch {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-bottom: 50px;
}

.switch {
    position: absolute;
    top: 20px;
    left: 61.6%;
    transform: translateX(-50%);
    display: inline-block;
    width: 100px;
    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: 0.4s;
    border-radius: 34px;
}

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

input:checked + .slider {
    background-color: #4CAF50;
}

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

@media (max-width: 600px) {
    .movie-page-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100vw;
    }

    .movie-page-item {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 10px;
        height: 220px;
        box-sizing: border-box;
        width: 100%;
        max-width: 95%;
        padding: 2px;
        flex-wrap: wrap;
    }

    .movie-page-item img {
        width: 40%;
        height: 60%;        
        object-fit: cover;
    }
    
    .movie-page-text {
        display: flex;
        flex-direction: column;
        align-items: flex-start; 
        gap: 5px;
        padding: 0 0px;
        width: 100%; 
    }

    .movie-page-data {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: center;
        width: 99vw;
        margin-left: -30px;
    }
    
    .movie-page-item h3{
        margin: 0;
        font-weight: normal;
        font-size: 1.4rem;
        letter-spacing: 0.6px;
    }
    
    .movie-page-item p {
        margin: 3px 0;
        display: block;
    }

    #radar-container iframe {
        width: 600px;
        height: 500px; 
        border: none;
    }

    #radar-container {
        margin-bottom: 40px;
        margin-left: -30px;
        align-items: center;
        display: flex;
        justify-content: center;
        width: 600px;
        height: 300px; 
    }

    #radar-chart {
        width: 100px;
        height: 200px;
    }

    .switch {
        position: static;
        margin: 10px auto 10px auto;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .slider {
        position: relative;
        cursor: pointer;
        top: 0;
        left: 40px;
        right: 0;
        bottom: 0;
        background-color: #ccc;
        transition: 0.4s;
        border-radius: 34px;
        width: 100px;
        height: 34px;
    }

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

    input:checked + .slider {
        background-color: #4CAF50;
    }

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

    .switch label {
        margin-right: 10px;
        font-size: 1rem;
    }

    #other-charts.show-pie-charts {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    #reddit-container,
    #youtube-container {
        width: 90vw;
        margin-bottom: 40px;
    }

    #youtube-container embed,
    #reddit-container embed {
        width: 100%;
    }

    button {
        width: 70%;
        max-width: 300px;
        margin: 0 auto;
        display: block;
    }

    .popup-content {
        width: 90%;
        height: 40vh;
    }

    #popup-chart {
        width: 100%;
        height: 75%;
        object-fit: contain;
    }
}

@media (min-width: 601px) and (max-width: 1000px) {
    .movie-page-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100vw;
    }

    .movie-page-item {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 10px;
        height: 200px;
        box-sizing: border-box;
        width: 100%;
        max-width: 95%;
        padding: 2px;
        flex-wrap: wrap;
    }

    .movie-page-item img {
        width: 40%;
        height: 60%;        
        object-fit: cover;
    }
    
    .movie-page-text {
        display: flex;
        flex-direction: column;
        align-items: flex-start; 
        gap: 5px;
        padding: 0 0px;
        width: 100%; 
    }

    .movie-page-data {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: center;
        width: 99vw;
        margin-left: -30px;
    }
    
    .movie-page-item h3{
        margin: 0;
        font-weight: normal;
        font-size: 1.4rem;
        letter-spacing: 0.6px;
    }
    
    .movie-page-item p {
        margin: 3px 0;
        display: block;
    }

    #radar-container {
        margin-bottom: 40px;
        margin-left: -30px;
        width: 800px;
    }

    #radar-chart {
        width: 100%;
        height: auto;
        max-height: 500px;
    }

    .switch {
        position: static;
        margin: 10px auto 10px auto;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .slider {
        position: relative;
        cursor: pointer;
        top: 0;
        left: 40px;
        right: 0;
        bottom: 0;
        background-color: #ccc;
        transition: 0.4s;
        border-radius: 34px;
        width: 100px;
        height: 34px;
    }

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

    input:checked + .slider {
        background-color: #4CAF50;
    }

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

    .switch label {
        margin-right: 10px;
        font-size: 1rem;
    }

    #other-charts.show-pie-charts {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    #reddit-container,
    #youtube-container {
        flex: 0;
        width: 100vw;
        margin-bottom: 40px;
        padding-right: 0px;
    }

    #youtube-container embed,
    #reddit-container embed {
        width: 100%;
    }

    button {
        width: 70%;
        max-width: 300px;
        margin: 0 auto;
        display: block;
    }

    .popup-content {
        width: 90%;
        height: 60vh;
    }

    #popup-chart {
        width: 100%;
        height: 88%;
    }
}

