html, body {
    height: 100%;
    margin: 0;
    font-family: 'Arial', sans-serif;
    background: #FFFFFF;
}

* {
  box-sizing: border-box; 
}

.wrapper {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    height: 100vh;
    max-width: 1500px;
    margin: auto;
    padding: 20px;
}

.content {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: 100%;
    width: 100%;
}

.header {
    display: flex;
    align-items: center; 
    margin-bottom: 20px; 
}

.logo-img {
    width: 50px; 
    height: auto; 
    margin-right: 10px; 
}

.logo {
    font-size: 34px;
    color: #000;
    margin: 0; 
}

.back-button {
    position: fixed; 
    right: 20px;    
    top: 20px;  
    cursor: pointer;
}

.screen {
    text-align: center;
    padding-top: 5%;
}

.directions {
    text-align: center;
}

.form-floating {
    margin-bottom: 20px;
    width: 300px; 
    margin: auto;
}

.suggestions {
    border: 1px solid #ccc;
    display: none;
    position: absolute;
    background-color: white;
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    width: 300px;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-top: 5px;
}

.suggestion-item {
    padding: 10px 15px; 
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0; 
    background-color: white;
    transition: background-color 0.2s ease; 
}

.suggestion-item:last-child {
    border-bottom: none; 
}

.suggestion-item:hover {
    background-color: #f0f0f0; 
}

.suggestion-item:active {
    background-color: #e0e0e0; 
}


.semester-section {
    margin: 20px 0;
}

.class-button {
    margin: 5px;
    padding: 10px 15px;
    background-color: #F8CAD3;
    color: #880720;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    display: inline-block;
    white-space: nowrap;
    font-size: 14px;
}

.class-button:hover {
    background-color: #efb3bf;
    color: white;
}

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

.custom-modal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 90%;
    max-width: 600px;
    margin: auto; 
    padding: 20px;
    box-sizing: border-box;

    background-color: #fefefe;
    margin: 10% auto;
    padding: 20px;
    overflow: hidden;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px; 
    height: auto;
    aspect-ratio: 1 / 1;
    z-index: 3; 
    display: flex;
    justify-content: center;
    align-items: center; 
    flex-direction: column; 
    border-radius: 20px;
}

.custom-close-button {
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    background: none;
    color: #AAA;
    align-self: flex-end;
}

.custom-close-button:hover,
.custom-close-button:focus {
    color: black;
}

#donutchart {
    width: 80%; 
    height: 80%;
    margin: auto; 
}

@media (max-width: 768px) {
    .logo-img {
        width: 60px; 
        margin-bottom: 5px; 
    }

    .logo {
        font-size: 1.5rem; 
    }

    .back-button {
        width: 70px; 
        height: auto; 
        position: fixed;
        top: 10px; 
        right: 10px; 
        cursor: pointer;
    }

    .header, .content, .wrapper {
        padding: 0 15px; 
    }

    .back-button {
        top: 10px;
        right: 10px;
    }

    .custom-modal-content {
        width: 95%;
        padding: 10px; 
    }
}

.button-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    z-index: 1000;
}

.main-button {
    background-color: #F8CAD3;
    color: #880720;
    border: none;
    padding: 15px 20px;
    margin: 0 10px;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.3s ease;
    border-radius: 15px; 
    z-index: 1;
}

.main-button:hover {
    background-color: #efb3bf;
    color: white;
}

@media (max-width: 850px) {
    .wrapper {
        flex-direction: column; 
        align-items: center;
        padding: 10px;
    }

    .content,
    .header {
        width: 100%; 
    }

    .logo-img {
        width: 40px;
    }

    .logo {
        font-size: 24px;
    }

    .back-button {
        right: 10px; 
        top: 10px;
    }

    .main-button {
        padding: 10px 15px; 
        font-size: 16px;
    }

    .custom-modal-content {
        width: 95%; 
        margin-top: 5%; 
        padding: 10px;
    }

    #donutchart {
        width: 100%; 
        height: 300px;
    }
}

@media (max-width: 768px) {
    .custom-modal-content {
        width: 95%;
        padding: 10px; 
    }
  }

  @media (max-width: 768px) {
    #donutchart {
        width: 80%; 
        height: 300px; 
    }

    .custom-modal-content {
        width: 95%;
    }
}

@media (max-width: 600px) {
    .custom-modal-content {
      position: fixed; 
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: auto; 
      max-width: 90%; 
      padding: 20px;
      background: #fff; 
      border-radius: 5px;
      box-shadow: 0 4px 8px rgba(0,0,0,0.1);
      z-index: 1050; 
    }
    
    .custom-modal {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: rgba(0,0,0,0.4);
      z-index: 1040;
    }
    
      .custom-modal-content {
        width: 80%; 
        padding: 10px; 
      }
    }

@media (max-width: 600px) {
    /* .custom-modal-content {
        width: auto;
        max-width: 90%;
        padding: 20px;
        border-radius: 5px;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        z-index: 1050;
    }*/

    #donutchart {
        width: 100%;
        height: 300px;
    } 
}

.gradeDistributions-image-container {
    position: fixed; 
    right: 0;       
    bottom: 0;
    z-index: 0;
}

@media (max-width: 1200px) {
    .gradeDistributions-image-container {
        display: none;
    }
}


@media (max-width: 600px) {
    .semester-section {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }

    .class-button {
        flex: 1 1 calc(50% - 20px); 
        margin: 5px 0;
    }
}

@media (max-width: 600px) {
    .semester-section {
        display: flex;
        flex-wrap: wrap;
        gap: 15px; 
    }

    .class-button {
        flex: 1 1 100%;
    }
}

/* Active/keyboard highlight for suggestions */
.suggestion-item.active,
.suggestion-item:focus-visible {
    background-color: #e8f0fe;
    outline: none;
}

.suggestion-empty {
    color: #999;
    font-style: italic;
    cursor: default;
}

.suggestion-empty:hover {
    background-color: white;
}

.rmp-link {
    display: block;
    text-align: center;
    font-size: 13px;
    color: #880720;
    margin: 10px 0 4px;
    text-decoration: none;
    opacity: 0.7;
}

.rmp-link:hover {
    opacity: 1;
    text-decoration: underline;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 4px solid #F8CAD3;
    border-top-color: #880720;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 40px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
