* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.section {
    width: 100%;
    height: 200px;
    place-content: center center;
    border: dashed;
    border-color: #000;
    border-width: 2px;
    border-radius: 15px 50px;
}

.header {
    width: 100%;
    min-height: 100px;
    place-content: center center;
    border: dashed;
    border-color: #002147;
    border-width: 2px;
    border-radius: 10px;
    background: #000;
    height: auto;
}

.navbar {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-evenly;
    flex-wrap: wrap; /* Changed from nowrap to wrap */
    padding: 10px 20px; /* Added top/bottom padding and reduced side padding so it looks better when wrapped */
    background-color: #000;
}

.navbar a {
    float: left;
    padding: 5px;
    color: white;
    font-size: 17px;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
}

.message {
    max-width: 960px;
    place-content: center center;
    border: solid;
    border-color: #FFF;
    border-width: 2px;
    border-radius: 10px;
    background: #FFF;
    height: auto;
    margin-left: auto;
    margin-right: auto;
    list-style-type: none;
}

.message ul {
    list-style-type: none;
}

.dropdown {
    float: none;
    text-align: center;
    position: relative;
}

.dropdown .dropbtn {
    font-size: 17px;
    border: none;
    color: white;
    padding: 12px;
    background-color: inherit;
    font-family: inherit;
    margin: 0;
    text-align: center;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    background-color: #000;
    padding: 8px;
    white-space: nowrap;
    z-index: 10;
    max-width: calc(100vw - 12px);
}

.dropdown-content a {
    display: block;
    float: none;
    clear: both;
    width: 100%;
    color: white;
    padding: 6px 12px;
    text-decoration: none;
    font-size: 17px;
    text-align: left;
    white-space: nowrap;
}

.admin-links {
    display: block;
    margin: 0;
    padding: 0;
}

.dropdown-content .admin-links a {
    display: block;
}

.page {
    display: flex;
    flex-wrap: wrap;
}

.index-page-title {
    width: 100%;
    text-align: center;
    margin-bottom: 18px;
    color: white;
}

.index-home-section {
    height: auto;
    min-height: 170px;
    padding: 16px;
}

.index-section-title {
    text-align: center;
    margin-bottom: 10px;
}

.index-section-link {
    text-align: center;
    margin-bottom: 8px;
    line-height: 1.45;
}

.student-home {
    background: #FFF;
}

.ta-home {
    background-color: #a2ceff;
}

.create-ticket {
    background: #FFF;
    padding: 10px;
    height: 300px;
}

.create-ticket-panel {
    height: auto;
    min-height: 340px;
    max-width: 700px;
    margin: 0 auto;
    padding: 22px 24px;
}

.create-ticket-title {
    text-align: center;
    margin-bottom: 16px;
}

.create-ticket-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.create-ticket-field {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    line-height: 1.45;
}

.create-ticket-field label {
    font-weight: 600;
    min-width: 90px;
    text-align: right;
}

.create-ticket-field input[type="text"],
.create-ticket-field select {
    min-height: 20px;
    padding: 1px 6px;
}

.create-ticket-actions {
    margin-top: 4px;
    text-align: center;
}

.create-ticket-actions input,
.create-ticket-actions button {
    padding: 4px 10px;
}

.wiki-page {
    margin-top: 20px;
}

.wiki-shell {
    width: 100%;
    height: auto;
    min-height: 450px;
    text-indent: 0;
    padding: 18px 22px;
}

.wiki-container {
    max-width: 1200px;
    margin: 0 auto;
}

.wiki-header {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 14px;
    border-bottom: 2px dashed #002147;
}

.wiki-header h1 {
    color: #10233b;
    margin-bottom: 8px;
}

.wiki-header .subtitle {
    color: #1e2c3d;
}

.wiki-search-section {
    margin-bottom: 22px;
    text-align: center;
}

.wiki-search-input {
    width: 100%;
    max-width: 540px;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid #9cb2ca;
    border-radius: 8px;
}

.wiki-content {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 24px;
}

.wiki-sidebar {
    background: #f5f8fc;
    border: 1px solid #d4e0ed;
    border-radius: 10px;
    padding: 14px;
    align-self: start;
}

.wiki-nav h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #10233b;
}

.wiki-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wiki-nav-list li {
    margin-bottom: 8px;
}

.wiki-nav-list .nav-link {
    display: block;
    text-decoration: none;
    color: #002147;
    padding: 6px 9px;
    border-radius: 6px;
}

.wiki-nav-list .nav-link:hover {
    background: #eaf1f8;
}

.wiki-main {
    min-width: 0;
}

.wiki-section {
    margin-bottom: 28px;
    padding-bottom: 18px;
    border-bottom: 1px solid #d6e1ec;
}

.wiki-section:last-of-type {
    border-bottom: 0;
}

.wiki-section h2,
.wiki-section h3,
.wiki-section h4 {
    color: #10233b;
    margin-bottom: 10px;
}

.wiki-section p,
.wiki-section li {
    color: #1e2c3d;
    line-height: 1.55;
}

.wiki-section p {
    margin-bottom: 10px;
}

.wiki-section ul,
.wiki-section ol {
    padding-left: 24px;
    margin: 8px 0 10px;
}

.wiki-footer {
    text-align: center;
    margin-top: 26px;
    padding-top: 14px;
    border-top: 1px solid #d6e1ec;
}

.back-to-top {
    color: #002147;
    text-decoration: none;
    border: 1px solid #8ea8c3;
    border-radius: 6px;
    padding: 6px 10px;
}

.back-to-top:hover {
    background: #eaf1f8;
}

/* Mobile Styles */
@media only screen and (width <= 400px) {
    body {
        background-color: #002147;
    }

    .navbar {
        padding: 10px 5px;
        gap: 8px;
    }

    .navbar a, .dropdown .dropbtn {
        font-size: 15px; /* Slightly reduce font size to fit better */
        padding: 4px;
    }
}

.live-queue {
    background: #FFF;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 25px;
    height: auto;
    max-width: 961px;
    border-radius: 50px;
}

.live-queue #tickets tbody td {
    font-size: 1.25rem;
}

.tickets {
    background: #FFF;
    border-radius: 15px;
    height: auto;
    min-height: 350px;
    text-indent: 10px;
    vertical-align: top;
}

.generic {
    background: #FFF;
    border-radius: 15px;
    height: auto;
    min-height: 350px;
    text-indent: 10px;
    padding: 15px;
}

.wormhole-content {
    padding: 25px;
    margin-top: 30px;
    border: dashed 2px #000;
    border-radius: 20px;
}

.subsection {
    margin-bottom: 25px;
}

.subsection:last-child {
    margin-bottom: 0;
}

.wormhole-content .subsection {
    margin-bottom: 28px;
    padding: 4px 2px;
    text-indent: 0;
}

.wormhole-content .subsection h4 {
    margin-bottom: 10px;
    color: #10233b;
}

.wormhole-content .subsection p,
.wormhole-content .subsection li {
    color: #1e2c3d;
    line-height: 1.55;
}

.wormhole-content .subsection p {
    margin-bottom: 10px;
}

.wormhole-content .subsection ul,
.wormhole-content .subsection ol {
    padding-left: 24px;
    margin: 8px 0 12px;
}

.wormhole-content .wormhole-schedule {
    padding: 10px 0;
}

.wormhole-content .wormhole-schedule h3,
.wormhole-content .wormhole-schedule h4 {
    color: #10233b;
    margin-bottom: 10px;
}

.wormhole-content .wormhole-schedule p,
.wormhole-content .wormhole-schedule li {
    color: #1e2c3d;
    font-size: 1rem;
    line-height: 1.55;
}

.wormhole-content .wormhole-schedule p {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 10px;
}

.wormhole-content .wormhole-schedule ul {
    padding-left: 24px;
    margin: 8px 0 14px;
}

.wormhole-content .wormhole-schedule iframe {
    margin-top: 14px;
    border: 1px solid #bccfe3 !important;
    border-radius: 10px;
    background: #fff;
}

.queue-dashboard-title {
    margin-bottom: 18px;
}

.queue-admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 28px;
}

.queue-admin-action-form {
    display: inline-flex;
}

.queue-admin-actions .btn-delete {
    padding: 5px 10px;
    min-height: 30px;
}

.queue-back-link {
    margin-top: 20px;
}

.profile {
    background: #BBA0CA;
    min-height: 250px;
    border-radius: 15px;
    height: auto;
}

.tick-info {
    background: #BBA0CA;
    min-height: 250px;
    border-radius: 0;
    height: 370px;
    text-indent: 20px;
    max-width: 400px;
    margin: auto;
}

.section.tick-info p {
    padding-top: 1.5cm;
}

.tick-resol {
    background: #BBA0CA;
    min-height: 250px;
    border-radius: 0;
    height: 370px;
    text-indent: 20px;
    max-width: 400px;
    margin: auto;
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* Tablet Styles */
@media only screen and (width >= 401px) and (width <= 960px) {
    body {
        background-color: #002147;
    }
}

/* Desktop Styles */
@media only screen and (width >= 961px) {
    body {
        background-color: #002147;
    }

    .page {
        width: 960px;
        margin: 0 auto;
    }

    .student-home,
    .ta-home {
        width: 50%;
    }

    .tick-info,
    .tick-resol {
        width: 50%;
    }

    .tickets,
    .profile {
        width: 50%;
    }

}

/* Flash Message Styles */
.flash-success {
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    padding: 10px;
    margin-bottom: 5px;
    border-radius: 4px;
}

.flash-error {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 10px;
    margin-bottom: 5px;
    border-radius: 4px;
}

.flash-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    padding: 10px;
    margin-bottom: 5px;
    border-radius: 4px;
}

.user-tables {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    margin: 15px;
}

.user-tables table {
    border-collapse: collapse;
}

.user-tables th {
    text-align: center;
    font-size: 1.2em;
    padding-bottom: 8px;
}

.manage-user-page {
    margin-bottom: 12px;
}

.manage-user-title {
    color: #fff;
}

.manage-user-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    align-items: stretch;
}

.manage-user-panel {
    width: 100%;
    min-width: 0;
    min-height: 350px;
    padding: 18px;
    display: flex;
    flex-direction: column;
}

.manage-user-form {
    margin-top: 10px;
    flex: 1;
}

.manage-user-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 12px;
}

.manage-user-input {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.manage-user-input label {
    min-width: 95px;
    font-weight: 600;
}

.manage-user-checkbox label {
    min-width: auto;
}

.manage-user-current {
    color: #1f1f1f;
    white-space: normal;
    overflow-wrap: anywhere;
}

.manage-user-row-email {
    flex-wrap: nowrap;
    align-items: center;
}

.manage-user-row-email .manage-user-input {
    flex: 1;
    min-width: 0;
}

.manage-user-row-email .manage-user-current {
    white-space: nowrap;
}

.manage-user-actions {
    margin-top: 16px;
}

.delete-user-note {
    margin-bottom: 14px;
    line-height: 1.45;
}

.form-error {
    display: block;
    color: #b00020;
    margin-bottom: 8px;
}

@media only screen and (width <= 960px) {
    .manage-user-grid {
        grid-template-columns: 1fr;
    }

    .manage-user-panel {
        width: 100%;
        min-height: auto;
    }

    .manage-user-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .manage-user-current {
        white-space: normal;
    }

    .manage-user-row-email {
        flex-wrap: wrap;
        align-items: flex-start;
    }
}