/* Reset basic spacing and ensure full viewport height */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

/* Main page container uses flexbox for vertical layout */
.page-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Make container at least full viewport height */
}

/* Main content area grows to fill available space */
.main-content {
    flex: 1;
    padding: 0px 20px 5px 20px;  /* Side padding for breathing room */
    overflow: hidden;            /* Prevent scrollbars inside */
}

/* Global font for body */
body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

/* Navbar styles */
.navbar {
    background-color: #EFF6F6;
    color: #333333;
    padding: 5px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #008080;
}

/* Logo image size and spacing */
.logo {
    height: 45px;
    vertical-align: middle;
    margin-right: 8px;
}

/* Welcome message next to logo */
.welcome-message {
    margin-left: 15px;
    font-size: 14px;
    color: #333333;
    font-weight: 500;
}

/* Left side of navbar aligns items horizontally */
.navbar-left {
    display: flex;
    align-items: center;
}

/* Right side links styling */
.navbar-right a {
    color: #333333;
    text-decoration: none;
    margin-left: 15px;
    font-weight: 500;
    transition: color 0.2s ease-in-out;
}

/* Hover effect for navbar links */
.navbar-right a:hover {
    color: #008080;
}

/* Modal background: fullscreen overlay, initially hidden */
.modal {
    position: fixed;
    inset: 0;                   /* shorthand for top/right/bottom/left 0 */
    background: rgba(0,0,0,.6); /* semi-transparent dark overlay */
    display: none;              /* hide modals by default */
    justify-content: center;
    align-items: center;
    z-index: 1000;              /* on top of other elements */
}

/* Show modal when toggled */
.modal.show { 
    display: flex;
}

/* Modal content box styling */
.modal-content {
    background: #f7f7f7;
    border-radius: 8px;
    padding: 30px 40px;
    width: 320px;
    max-width: 90%;             /* responsive on smaller screens */
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
    position: relative;
}

/* Modal heading color and spacing */
.modal-content h2 {
    margin-top: 0;
    color: #008080;
}

/* Close button positioned top-right */
.close {
    position: absolute;
    top: 12px;
    right: 14px;
    font-size: 22px;
    cursor: pointer;
    color: #666;
}

/* Form inside modal uses vertical layout with spacing */
.modal-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Labels inside forms */
.modal-form label {
    color: #333333;
    font-weight: 600;
    font-size: 14px;
}

/* Input fields styling */
.modal-form input {
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Buttons inside modal */
.modal-form button {
    padding: 10px;
    border: none;
    border-radius: 4px;
    background: #008080;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
}

/* Button hover effect */
.modal-form button:hover {
    background: #333333;
}

/* Small links inside modal for switching forms */
.small-link {
    font-size: 12px;
    text-align: right;
    color: #008080;
    text-decoration: none;
}

/* Hover effect for small links */
.small-link:hover {
    text-decoration: underline;
}

/* Page title styling */
.page-title {
    text-align: center;
    font-style: italic;
    color: #333333;
    font-size: 22px;
}

/* University Search Form container */
.search-form {
    width: fit-content;
    margin: 10px auto;
    padding: 15px 25px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: #F5F9F9;
}

/* Layout for input fields row */
.input-row {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 12px;
}

/* Each input container stacks label and input vertically */
.input-row div {
    display: flex;
    flex-direction: column;
}

/* Labels in search form */
.search-form label {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 5px;
    color: #333333;
}

/* Text inputs */
.search-form input {
    padding: 5px 8px;
    font-size: 13px;
    width: 225px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Input focus state with teal outline */
input:focus {
    outline: none;
    border: 1px solid #008080;
    box-shadow: 0 0 4px rgba(0, 128, 128, 0.5);
}

/* Button container centers button */
.button-row {
    text-align: center;
}

/* Search button style */
.search-form button {
    padding: 6px 14px;
    font-size: 13px;
    background-color: #008080;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    width: 160px;
}

/* Button hover changes color */
.search-form button:hover {
    background-color: #333333;
}

/* Response messages for info, error, success */
.response-message {
    margin-top: 20px;
    padding: 10px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

/* Info message styling */
.response-message.info {
    background-color: #f0f8ff;
    border: 1px solid #5b9bd5;
    color: #1f4e79;
}

/* Error message styling */
.response-message.error {
    background-color: #ffe0e0;
    border: 1px solid #ff5c5c;
    color: #a80000;
}

/* Search results container with scroll */
.results-box {
    width: fit-content;
    margin: 20px auto 5px auto;
    padding: 0px 10px 10px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #F5F9F9;
    text-align: left;
    height: calc(100vh - 345px);  /* Limit height for scrolling */
    overflow-y: auto;
    position: relative;
}

/* Sticky header inside results for better UX */
.results-heading {
    font-style: italic;
    color: #333333;
    position: sticky;
    top: 0;
    background-color: #F5F9F9;
    padding: 10px 10px;
    margin: 0;
    z-index: 2;
    border-bottom: 1px solid #ccc;
    font-size: 15px;
}

/* Each result item flex container */
.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    border-bottom: 1px solid #ccc;
    background-color: #ffffff;
    gap: 16px;
}

/* University name styling with truncation */
.result-item > .uni-name {
    flex: 2;
    font-weight: 600;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Link styling for university website */
.result-item > .uni-link a {
    color: #008080;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

/* Hover effect for university link */
.result-item > .uni-link a:hover {
    text-decoration: underline;
    color: #333333;
}

/* Save button styling */
.result-item > .uni-save .save-btn {
    background-color: #008080;
    color: white;
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Save button hover effect */
.result-item > .uni-save .save-btn:hover {
    background-color: #333333;
}

/* Remove button styling */
.result-item > .uni-save .remove-btn {
    background-color: #ff5c5c;
    color: white;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Remove button hover effect */
.result-item > .uni-save .remove-btn:hover {
    background-color: #333333;
}

/* Footer styling */
.site-footer {
    background-color: #EFF6F6;
    color: #333333;
    text-align: center;
    padding: 4px 30px;
    font-size: 14px;
    border-top: 2px solid #008080;
}
