/* Page background */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #49814f;
}

/* Main page layout */
main {
    width: calc(100% - 64px);
    margin: 0 32px;
    padding: 24px 0 40px;
}

section {
    margin-bottom: 24px;
}

/* Map area layout */
.ns_mapSection {
    display: grid;
    grid-template-columns: 882px 1fr;
    gap: 24px;
    align-items: start;
}

.ns_mapTools {
    display: grid;
    grid-template-columns: 776px 106px;
    gap: 0;
}

/* Header */
.ns_pageHeader {
    background: #f4c542;
    color: #17364d;
}

.ns_headerContent {
    width: 1180px;
    margin: 0 auto;
    padding: 16px 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.ns_headerIcon {
    width: 52px;
    height: 52px;
    object-fit: contain;
    cursor: pointer;
}

.ns_headerText {
    width: 560px;
}

.ns_pageHeader h1 {
    margin: 0;
    font-size: 32px;
}

.ns_pageHeader p {
    margin: 4px 0 0;
    color: #17364d;
    font-size: 15px;
}

/* Mobile menu button */
.ns_menuButton {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 10px;
    background: #ba1f33;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.ns_menuButton span {
    width: 22px;
    height: 3px;
    border-radius: 3px;
    background: #ffffff;
}

/* Place search */
.ns_searchForm {
    width: 882px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.ns_searchInput {
    width: 828px;
    height: 42px;
    border: 0;
    border-radius: 10px 0 0 10px;
    padding: 0 14px;
    color: #17364d;
    font-size: 14px;
}

.ns_inputError {
    outline: 2px solid #ba1f33;
}

.ns_searchButton {
    width: 54px;
    height: 42px;
    border: 0;
    border-radius: 0 10px 10px 0;
    background: #2c2c2c;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.ns_searchButton img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.ns_searchError {
    width: 100%;
    margin: 6px 0 0;
    color: #8d1022;
    font-size: 13px;
    font-weight: 700;
}

/* City navigation */
.ns_cityControls {
    width: 432px;
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.ns_cityButton {
    width: 132px;
    border: 0;
    border-radius: 10px;
    background: #ba1f33;
    color: #ffffff;
    padding: 13px 12px;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
}

.ns_cityButton.ns_active {
    background: #8f1525;
}

/* Text spacing */
h1, h2 {
    margin: 0 0 16px;
}

p, li {
    line-height: 1.6;
}

/* Category filters */
.ns_categoryPanel {
    height: 776px;
    box-sizing: border-box;
    padding: 12px;
    background: #d7e6f4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
}

.ns_filterTitle {
    width: 76px;
    color: #17364d;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

.ns_categoryButton {
    width: 66px;
    height: 66px;
    border: 0;
    border-radius: 8px;
    background: #f8fbff;
    color: #17364d;
    padding: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 9px;
    font-weight: 700;
    cursor: pointer;
}

.ns_categoryButton img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.ns_categoryButton.ns_active {
    outline: 3px solid #486dd6;
}

.ns_categoryButton:disabled {
    background: #d1d5db;
    color: #6b7280;
    cursor: not-allowed;
}

.ns_categoryButton:disabled img {
    filter: grayscale(1);
    opacity: 0.38;
}

/* Rating filters */
.ns_ratingFilter {
    width: 76px;
    color: #17364d;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ns_ratingButtons {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.ns_ratingButton {
    width: 52px;
    height: 52px;
    border: 0;
    background: url("../images/ratings/starGrey.png") center / contain no-repeat;
    color: #17364d;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
}

.ns_ratingButton.ns_active {
    background-image: url("../images/ratings/star.png");
    color: #ffffff;
}

.ns_ratingButton:disabled {
    background-image: url("../images/ratings/starGrey.png");
    color: #6b7280;
    cursor: not-allowed;
}

/* Day planner */
.ns_dayPanel {
    box-sizing: border-box;
    width: 100%;
    min-height: 320px;
    padding: 18px;
    color: #ffffff;
}

.ns_dayPanel h2 {
    margin: 0 0 10px;
    font-size: 22px;
}

.ns_dayIntro {
    margin: 0 0 16px;
    font-size: 14px;
    line-height: 1.4;
}

.ns_dayIntro strong {
    color: #f4c542;
    font-size: 16px;
}

.ns_weatherPanel {
    width: 520px;
    box-sizing: border-box;
    margin: 0 0 16px;
    padding: 12px;
    border-left: 4px solid #f4c542;
    background: #d7e6f4;
    color: #17364d;
    font-size: 14px;
    line-height: 1.4;
}

.ns_weatherPanel strong {
    display: block;
    margin-bottom: 4px;
}

/* Travel mode toggle */
.ns_travelMode {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    font-size: 14px;
    color: #ffffff;
}

.ns_travelButton {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 2px solid #ffffff;
    border-radius: 20px;
    background: transparent;
    color: #ffffff;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.ns_travelButton:hover {
    background: rgba(255, 255, 255, 0.15);
}

.ns_travelButton.ns_active {
    background: #f4c542;
    border-color: #f4c542;
    color: #17364d;
    font-weight: bold;
}

/* Day route builder */
.ns_routeScroll {
    width: 100%;
}

.ns_routeBuilder {
    width: 100%;
    max-width: 520px;
    height: 430px;
    margin-top: 24px;
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, 96px);
    grid-template-rows: repeat(4, 76px);
    gap: 30px 28px;
}

.ns_routeSlot,
.ns_routeAddButton {
    position: relative;
    box-sizing: border-box;
    width: 96px;
    height: 76px;
    z-index: 1;
}

.ns_routeSlotAction,
.ns_routeAddButton {
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    border: 2px solid #f4c542;
    border-radius: 18px;
    background: #f8fbff;
    color: #17364d;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.ns_routeSlotAction {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0 10px;
    text-align: center;
}

.ns_routeAddButton {
    background: #ba1f33;
    color: #ffffff;
    font-size: 44px;
}

.ns_routeSlot.ns_active .ns_routeSlotAction {
    background: #f4c542;
}

.ns_routeSlot.ns_filled .ns_routeSlotAction {
    overflow: hidden;
    padding: 8px;
    font-size: 12px;
    line-height: 1.2;
}

.ns_routeDeleteButton {
    position: absolute;
    top: -8px;
    right: -8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: #ba1f33;
    color: #ffffff;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    z-index: 2;
}

.ns_routeDeleteButton:hover,
.ns_routeDeleteButton:focus {
    background: #8f1726;
}

.ns_routeLine {
    content: "";
    position: absolute;
    background: #f4c542;
    z-index: 0;
}

.ns_routeSlot[hidden],
.ns_routeAddButton[hidden] {
    display: none;
}

/* Google map */
#ns_map {
    box-sizing: border-box;
    width: 776px;
    height: 776px;
    border: 4px solid #d7e6f4;
    background: #dfe7ef;
}

/* Google Places info window */
.ns_placeInfo {
    width: 260px;
    font-size: 14px;
}

.ns_placePhoto {
    width: 260px;
    height: 150px;
    object-fit: cover;
    display: block;
    margin-bottom: 8px;
}

.ns_placeRating {
    margin: 6px 0;
    color: #17364d;
    font-weight: 700;
}

.ns_placeBudget {
    margin: 8px 0;
    padding: 8px;
    border-left: 4px solid #f4c542;
    background: #f7fafc;
    color: #17364d;
    line-height: 1.35;
}

.ns_placeBudget strong {
    display: block;
    margin-bottom: 4px;
}

.ns_stadiumInfo {
    width: 320px;
    font-size: 14px;
}

.ns_stadiumInfo strong {
    display: block;
    margin-bottom: 4px;
    font-size: 18px;
}

.ns_stadiumInfo span {
    display: block;
    margin-bottom: 10px;
    color: #ba1f33;
    font-weight: 700;
}

.ns_stadiumInfo p {
    margin: 0 0 10px;
    line-height: 1.4;
}

.ns_stadiumInfo ul {
    padding-left: 18px;
}

.ns_stadiumInfo li {
    margin-bottom: 6px;
    line-height: 1.35;
}

/* List spacing */
ul {
    margin: 0;
    padding-left: 20px;
}

/* Smaller desktop layout */
@media (max-width: 1200px) {
    .ns_headerContent {
        width: 940px;
    }

    .ns_headerText {
        width: 430px;
    }

    .ns_cityControls {
        width: 396px;
    }

    .ns_cityButton {
        width: 120px;
    }

    .ns_searchForm {
        width: 882px;
    }

    .ns_searchInput {
        width: 828px;
    }

    .ns_mapSection {
        grid-template-columns: 882px;
        gap: 18px 0;
    }

    .ns_mapTools {
        grid-template-columns: 776px 106px;
    }

    .ns_dayPanel {
        width: 882px;
    }

}

/* Tablet layout */
@media (max-width: 950px) {
    main {
        width: 704px;
        margin: 0 auto;
        padding: 24px 0 40px;
    }

    .ns_mapSection {
        grid-template-columns: 704px;
        gap: 16px 0;
    }

    .ns_mapTools {
        grid-template-columns: 596px 108px;
    }

    .ns_dayPanel {
        width: 704px;
        color: #ffffff;
    }

    .ns_categoryPanel {
        height: 596px;
        gap: 5px;
    }

    .ns_categoryButton {
        width: 56px;
        height: 56px;
        font-size: 8px;
    }

    .ns_categoryButton img {
        width: 28px;
        height: 28px;
    }

    .ns_ratingButton {
        width: 42px;
        height: 42px;
        font-size: 15px;
    }

    .ns_headerContent {
        width: 700px;
    }

    .ns_headerText {
        width: 620px;
    }

    .ns_cityControls {
        width: 700px;
        margin-left: 0;
        justify-content: flex-start;
    }

    .ns_searchForm {
        width: 704px;
    }

    .ns_searchInput {
        width: 650px;
    }

    #ns_map {
        width: 596px;
        height: 596px;
    }
}

/* Narrow tablet layout */
@media (max-width: 768px) {
    main {
        width: 560px;
    }

    .ns_headerContent {
        width: 560px;
    }

    .ns_headerText {
        width: 488px;
    }

    .ns_cityControls {
        width: 560px;
    }

    .ns_searchForm {
        width: 560px;
    }

    .ns_searchInput {
        width: 506px;
    }

    .ns_mapSection {
        grid-template-columns: 560px;
    }

    .ns_mapTools {
        grid-template-columns: 452px 108px;
    }

    .ns_dayPanel {
        width: 560px;
    }

    .ns_categoryPanel {
        height: 452px;
        padding: 8px;
        gap: 4px;
    }

    .ns_filterTitle,
    .ns_ratingFilter {
        font-size: 12px;
    }

    .ns_categoryButton {
        width: 42px;
        height: 42px;
        font-size: 7px;
    }

    .ns_categoryButton img {
        width: 22px;
        height: 22px;
    }

    .ns_ratingButtons {
        gap: 2px;
    }

    .ns_ratingButton {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }

    #ns_map {
        width: 452px;
        height: 452px;
    }
}

/* Mobile layout */
@media (max-width: 600px) {
    main {
        width: 340px;
        margin: 0 auto;
        padding: 20px 0 32px;
    }

    section {
        margin-bottom: 20px;
    }

    .ns_mapSection {
        grid-template-columns: 340px;
        gap: 14px 0;
    }

    .ns_mapTools {
        grid-template-columns: 340px;
    }

    .ns_headerContent {
        width: 340px;
        padding: 14px 0;
        gap: 12px;
    }

    .ns_headerIcon {
        width: 42px;
        height: 42px;
    }

    .ns_headerText {
        width: 220px;
    }

    .ns_menuButton {
        display: flex;
        margin-left: auto;
    }

    .ns_searchForm {
        width: 340px;
    }

    .ns_searchInput {
        width: 286px;
    }

    .ns_pageHeader h1 {
        font-size: 26px;
    }

    .ns_pageHeader p {
        font-size: 14px;
    }

    .ns_cityControls {
        width: 340px;
        margin-left: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .ns_cityButton {
        width: 340px;
        padding: 10px 6px;
        font-size: 13px;
    }

    .ns_cityControls.ns_open {
        display: flex;
    }

    .ns_categoryButton {
        width: 66px;
        height: 66px;
        font-size: 10px;
    }

    .ns_categoryPanel {
        width: 340px;
        height: auto;
        padding: 10px;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
    }

    .ns_dayPanel {
        width: 340px;
        padding: 14px;
    }

    .ns_weatherPanel {
        width: 312px;
    }

    .ns_dayPanel h2 {
        font-size: 20px;
    }

    .ns_filterTitle {
        width: 100%;
        text-align: left;
    }

    .ns_ratingFilter {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 8px;
        text-align: left;
    }

    .ns_ratingButtons {
        margin-top: 0;
        flex-direction: row;
        gap: 4px;
    }

    .ns_ratingButton {
        width: 42px;
        height: 42px;
        font-size: 16px;
    }

    .ns_categoryButton img {
        width: 34px;
        height: 34px;
    }

    #ns_map {
        width: 340px;
        height: 340px;
    }

    .ns_routeBuilder {
        width: 312px;
        max-width: none;
        height: 300px;
        grid-template-columns: repeat(4, 66px);
        grid-template-rows: repeat(4, 54px);
        gap: 22px 16px;
    }

    .ns_routeSlot,
    .ns_routeAddButton {
        width: 66px;
        height: 54px;
    }

    .ns_routeSlotAction,
    .ns_routeAddButton {
        border-radius: 12px;
        font-size: 12px;
    }

    .ns_routeAddButton {
        font-size: 32px;
    }

    .ns_routeDeleteButton {
        top: -7px;
        right: -7px;
        width: 18px;
        height: 18px;
        font-size: 13px;
    }

    .ns_routeScroll {
        padding-bottom: 0;
    }
}

/* Small mobile layout */
@media (max-width: 400px) {
    main {
        width: 300px;
    }

    .ns_mapSection {
        grid-template-columns: 300px;
    }

    .ns_mapTools {
        grid-template-columns: 300px;
    }

    .ns_categoryPanel {
        width: 300px;
    }

    .ns_dayPanel {
        width: 300px;
    }

    .ns_headerContent {
        width: 300px;
    }

    .ns_headerText {
        width: 194px;
    }

    .ns_searchForm {
        width: 300px;
    }

    .ns_searchInput {
        width: 246px;
    }

    .ns_cityControls {
        width: 300px;
    }

    .ns_cityButton {
        width: 300px;
        font-size: 12px;
    }

    #ns_map {
        width: 300px;
        height: 300px;
    }

    .ns_routeBuilder {
        width: 276px;
        height: 276px;
        grid-template-columns: repeat(4, 60px);
        grid-template-rows: repeat(4, 50px);
        gap: 20px 12px;
    }

    .ns_routeSlot,
    .ns_routeAddButton {
        width: 60px;
        height: 50px;
    }

    .ns_routeSlotAction,
    .ns_routeAddButton {
        font-size: 11px;
    }

    .ns_weatherPanel {
        width: 276px;
    }
}
