/* ==============================
   기본 설정
============================== */

* {
    box-sizing: border-box;
}


body {
    margin: 0;

    font-family:
        Arial,
        "Noto Sans KR",
        sans-serif;

    background-color: #f4f6f8;

    color: #222;
}


/* ==============================
   전체 영역
============================== */

.container {
    max-width: 1250px;

    margin: 0 auto;

    padding: 30px 20px 50px;
}


/* ==============================
   제목
============================== */

h1 {
    text-align: center;

    font-size: 40px;

    margin-bottom: 30px;
}


.description {
    text-align: center;

    color: #666;

    font-size: 18px;

    margin-bottom: 30px;
}


/* ==============================
   주차장 정보 불러오기
============================== */

#loadBtn {
    display: block;

    margin: 0 auto 25px;

    padding: 13px 25px;

    font-size: 17px;

    cursor: pointer;

    background-color: white;

    border: 1px solid #888;

    border-radius: 5px;
}


#loadBtn:hover {
    background-color: #eeeeee;
}


/* ==============================
   검색
============================== */

.search-box {
    display: flex;

    justify-content: center;

    gap: 10px;

    margin: 25px 0 35px;
}


.search-box input {
    width: 410px;

    padding: 13px 15px;

    font-size: 17px;

    border: 1px solid #999;

    border-radius: 6px;

    outline: none;
}


.search-box input:focus {
    border-color: #333;
}


.search-box button {
    padding: 12px 20px;

    font-size: 16px;

    cursor: pointer;

    border: 1px solid #999;

    border-radius: 6px;

    background-color: white;
}


.search-box button:hover {
    background-color: #eeeeee;
}


/* ==============================
   전체 개수 / 검색 결과
============================== */

#summary {
    margin: 20px 0;

    font-size: 20px;
}


#summary strong {
    font-size: 22px;
}


/* ==============================
   주차장 카드 목록
============================== */

.parking-list {
    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 18px;
}


/*
   검색 결과인 경우

   1개 → 가운데
   2개 → 가운데
   3개 이상 → 가운데 정렬
*/
.parking-list.search-mode {

    grid-template-columns:
        repeat(auto-fit,
            minmax(320px, 400px));

    justify-content: center;
}


/* ==============================
   주차장 카드
============================== */

.parking-card {
    background-color: white;

    padding: 24px;

    border-radius: 12px;

    box-shadow:
        0 2px 10px rgba(0, 0, 0, 0.08);
}


.parking-card h2 {
    margin-top: 0;

    margin-bottom: 20px;

    font-size: 23px;
}


.parking-card p {
    color: #666;

    font-size: 16px;
}


/* ==============================
   주차면 정보
============================== */

.parking-info {
    display: flex;

    gap: 15px;

    margin: 30px 0 25px;
}


.parking-info div {
    flex: 1;

    text-align: center;

    background-color: #f5f5f5;

    padding: 15px 8px;
}


.parking-info span {
    display: block;

    font-size: 14px;

    color: #666;

    margin-bottom: 7px;
}


.parking-info strong {
    display: block;

    font-size: 25px;

    color: #000;
}


/* ==============================
   상태
============================== */

.status {
    padding: 12px;

    border-radius: 7px;

    text-align: center;

    font-size: 17px;

    font-weight: bold;
}


/* 여유 */
.good {
    background-color: #d8f2df;
}


/* 보통 */
.normal {
    background-color: #fff0bd;
}


/* 혼잡 */
.busy {
    background-color: #ffdda9;
}


/* 만차 */
.full {
    background-color: #f6cccc;
}


/* 정보없음 */
.unknown {
    background-color: #eeeeee;

    color: #666;
}


/* ==============================
   갱신 시간
============================== */

.update-time {
    margin-top: 20px;

    font-size: 14px;

    color: #777;
}


/* ==============================
   페이지
============================== */

.paging {
    display: flex;

    justify-content: center;

    align-items: center;

    gap: 20px;

    margin: 35px 0;
}


.paging button {
    padding: 10px 20px;

    font-size: 15px;

    cursor: pointer;
}


/* ==============================
   검색 결과 없음
============================== */

.no-result {
    grid-column: 1 / -1;

    text-align: center;

    font-size: 18px;

    padding: 40px;
}


/* ==============================
   오류
============================== */

.error {
    grid-column: 1 / -1;

    text-align: center;

    color: red;

    font-size: 18px;
}


/* ==============================
   태블릿
============================== */

@media (max-width: 900px) {

    .parking-list {
        grid-template-columns:
            repeat(2, 1fr);
    }


    .parking-list.search-mode {

        grid-template-columns:
            repeat(auto-fit,
                minmax(300px, 400px));
    }
}


/* ==============================
   스마트폰
============================== */

@media (max-width: 600px) {

    .container {
        padding: 20px 12px;
    }


    h1 {
        font-size: 30px;
    }


    .description {
        font-size: 15px;
    }


    .search-box {
        flex-direction: column;
    }


    .search-box input {
        width: 100%;
    }


    .parking-list {
        grid-template-columns: 1fr;
    }


    .parking-list.search-mode {
        grid-template-columns: 1fr;
    }


    .parking-info {
        gap: 6px;
    }


    .parking-info strong {
        font-size: 21px;
    }
}