@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Funnel+Sans:ital,wght@0,300..800;1,300..800&display=swap');


* {
    margin: 0;
}

:root {
    /* =====colors===== */
    --body-color: #F0F2F5;
    --sidebar-color1: #4F4F4F;
    --sidebar-color2: #2b2b2b;
    --selection-color: #6b6b6b;
    --tap-color: #005ED0;
    --base-color1: #63B967;
    --base-color2: #47A34B;
}

/* Body section */
body {
    display: grid;
    grid-template-columns: 285px 1fr 20px;
    grid-template-rows: 117px 1fr 2.5rem;
    grid-template-areas:
        "sidebar navbar right-margin"
        "sidebar main right-margin"
        "sidebar footer footer";
    min-height: 100vh;
    background-color: var(--body-color);
    font-family: "Roboto", serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
}

/* Navigation Section */
nav {
    /* background-color: #ffffffb4; */
    padding: 1.5em;
    border-radius: 7px;
    /* border: solid #838383 1px; */
    top: 25px;
    position: sticky;
    grid-area: navbar;
    margin-top: auto;
    margin-bottom: auto;
    display: flex;
    justify-content: space-between;
    backdrop-filter: blur(1.5px);

}

nav .bt1 {
    color: #838383;
    font-weight: 700;
    font-size: 22px;
    display: flex;
    align-items: center;
    gap: 5px;
}

nav .rightnavContent a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

/* Sidebar section */
aside {
    grid-area: sidebar;
}

.sidebar .head_logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.sidebar {
    position: fixed;
    top: 15px;
    left: 15px;
    bottom: 15px;
    width: 225px;
    padding: 10px 14px;
    border-radius: 10px;
    justify-content: center;
    background-image:
        linear-gradient(20deg, rgb(32, 32, 37) 30%, rgb(62, 62, 71));
    transition: transform 0.3s ease-in-out;
    transform: translateX(-250px);
}

.sidebar.active {
    transform: translateX(0);
}

.sidebar .img-text img {
    height: 35px;
    padding-top: 35px;
    padding-bottom: 15px;
}

.sidebar.img-text {
    display: flex;
    align-items: center;
}

.header_title {
    color: white;
    font-size: 17px;
}

.nav_button {
    list-style-type: none;
    padding: 0;
    margin: 0;
    margin-top: 100px;
    border-style: none;
    border-color: none;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

.nav_button li a {
    color: white;
    font-style: none;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease-in-out;
}

.nav_button .bt2 {

    width: 225px;
    border-radius: 7px;
    background-image:
        linear-gradient(5deg, rgb(45, 131, 236) 60%, rgb(82, 171, 255));
}

.nav_button .bt1,
.nav_button .bt2,
.nav_button .bt3,
.nav_button .bt4 {
    padding: 12px;
    width: 225px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-sizing: border-box;
    transition: all 0.19s ease-in-out;
}

.nav_button .bt1:hover,
.nav_button .bt2:hover,
.nav_button .bt3:hover,
.nav_button .bt4:hover {
    width: 225px;
    border-radius: 7px;
    background-color: #c9c9c949;
}

/* Hamburger icon */
.hamburger {
    position: absolute;
    top: 30px;
    left: 30px;
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: 1000;
}

.hamburger .bar {
    width: 30px;
    height: 4px;
    background-color: #818181;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}


.hamburger.active .bar:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
    background-color: #ffffff;
}

.hamburger.active .bar:nth-child(2) {
    opacity: 0;
}

.hamburger.active .bar:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
    background-color: #ffffff;
}


/* main part designs */
main {
    grid-area: main;
    display: grid;
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
        "belt-section"
        "filter"
        "bus-lists";
    gap: 1.5rem;
    padding: 1.5rem;
    /* margin-left: 20px; */
    /* Prevent overlap with sidebar */
}

/* Belt Section */
main .belt-section {
    grid-area: belt-section;
    display: flex;
    justify-content: flex-start;
    gap: 1.5rem;
    padding: 1rem;
    flex-wrap: wrap;
}

main .belt-section button {
    min-width: 12em;
    height: 3.5em;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    background-color: #ffffff;
    border: 2px solid var(--base-color2);
    border-radius: 8px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

main .belt-section button:hover {
    background-color: var(--base-color2);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

main .belt-section button svg {
    transition: all 0.2s ease;
}

main .belt-section button:hover svg {
    fill: white;
}

/* Filter Section */
main .filter {
    grid-area: filter;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px #0000000d;
}

main .filter select {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    background-color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

main .filter select:focus {
    outline: none;
    border-color: var(--base-color2);
    box-shadow: 0 0 0 2px rgba(71, 163, 75, 0.2);
}

main .filter-out {
    padding: 0.75rem 1.5rem;
    background-color: var(--base-color2);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

main .filter-out:hover {
    background-color: var(--base-color1);
    transform: translateY(-1px);
}

/* Bus Lists Section */
main .bus-lists {
    grid-area: bus-lists;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
}

/* Bus Card Design */
.bus-card {
    background: white;
    border-radius: 10px;
    height: 15em;
    padding: 1.5rem;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border-left: 4px solid var(--base-color2);
}

.bus-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.bus-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #eee;
}

.bus-number {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--base-color2);
}

.bus-route {
    margin: 1rem 0;
}

.route {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.route-point {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--base-color2);
}

.route-time {
    font-size: 0.9rem;
    color: #666;
}

.bus-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.bus-capacity {
    font-size: 0.9rem;
    color: #666;
}

.bus-actions button {
    padding: 0.5rem 1rem;
    background-color: #ff4d4d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bus-actions button:hover {
    background-color: var(--base-color1);
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal.active {
    display: block;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    width: 70%;
    max-width: 800px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: black;
}

/* Text editor styles */
.text-editor-toolbar {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
    padding: 8px;
    background: #f5f5f5;
    border-radius: 4px;
}

.tool-btn,
.color-picker,
.font-size {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
}

.text-editor {
    min-height: 200px;
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 4px;
    background: white;
}

.submit-notice {
    background-color: #47A34B;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.submit-notice:hover {
    background-color: #3d8b40;
}

/* Bus Modal Styles */
#busModal .modal-content {
    max-width: 500px;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input {
    width: 93.5%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

.submit-btn {
    padding: 0.75rem 1.5rem;
    background-color: var(--base-color2);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.submit-btn:hover {
    background-color: var(--base-color1);
}

.cancel-btn {
    padding: 0.75rem 1.5rem;
    background-color: #f0f0f0;
    color: #333;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cancel-btn:hover {
    background-color: #e0e0e0;
}


/* Bus Status Indicators */
.status-available {
    color: var(--base-color2);
    font-weight: 500;
}

.status-full {
    color: #ff4d4d;
    font-weight: 500;
}

/* Notice card styles */
.notice-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

.notice-actions {
    position: absolute;
    top: 15px;
    right: 15px;
}

.delete-notice {
    background: #ff4d4d;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 12px;
}

.delete-notice:hover {
    background: #ff1a1a;
}

/* Modal buttons */
.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.clear-notices {
    background-color: #ff4d4d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.clear-notices:hover {
    background-color: #ff1a1a;
}

/* Notice Management Tabs */
.notice-management-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    position: relative;
}

.tab-btn.active {
    color: #47A34B;
    font-weight: bold;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #47A34B;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Notices List */
.notices-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
}

.notice-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

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

.notice-item input[type="checkbox"] {
    margin-right: 10px;
}

.notice-preview {
    flex: 1;
    max-height: 60px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}

.notice-date {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.management-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.delete-selected {
    background-color: #ff4d4d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    flex: 1;
}

.delete-selected:hover {
    background-color: #ff1a1a;
}

.clear-notices {
    background-color: #ff4d4d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    flex: 1;
}

.clear-notices:hover {
    background-color: #ff1a1a;
}



/* footer section */
footer {
    grid-area: footer;
    font-size: 1.1rem;
    margin: auto;
}

/* ---------- Responsive ---------- */

@media (max-width: 768px) {

    nav {
        top: 60px;
    }

    .sidebar {
        transform: translateX(-120%);
        z-index: 999;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .hamburger {
        display: flex;
    }

    body {
        grid-template-columns: 0.5px 1fr 0.5px;
        grid-template-rows: 117px 1fr 6rem;
    }

    main {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    main .filter {
        display: flex;
        flex-direction: column;
        width: 72%;
        padding-top: 2rem;
    }

    main .filter select {
        width: 15rem;
    }

    main .belt-section {
        display: flex;
        flex-direction: column;
        width: 18.6em;
    }

    .bus-card {
        height: 12em;
        width: 15em;
        padding: 1.5rem;
    }

    main .bus-lists {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    footer {
        font-size: 0.8rem;
        text-align: center;
    }
}

@media (min-width: 769px) {
    .sidebar {
        transform: translateX(0);
    }

    .hamburger {
        display: none;
    }
}