/* ===== 기본 리셋 & 변수 설정 ===== */
:root {
    /* ===== Woori FG Style Palette (Blue Theme) ===== */
    /* Original Green Palette Preserved for Rollback:
    --color-main-green: #8DB57D;
    --color-sub-green-1: #AAB9A5;
    --color-sub-green-2: #8DB57D;
    --color-bg: #F9F9F7;
    --color-primary: #8DB57D;
    --color-primary-hover: #769C68;
    */

    /* Blue Palette - Pastel Tones */
    --color-main-green: #5D9CEC;
    /* Pastel Blue Main */
    --color-sub-green-1: #A0D2EB;
    /* Very Light Pastel Blue */
    --color-sub-green-2: #4A89DC;
    /* Slightly darker for text visibility */

    /* Backgrounds & Text */
    --color-bg: #F4F8FB;
    /* Very Soft Blue-Grey Background */
    --color-card-bg: #FFFFFF;
    --color-text-main: #4A4F54;
    /* Softer Dark Grey */
    --color-text-sub: #7A869A;
    /* Blue-tinted Grey */
    --color-border: #E1E8EE;

    /* Functional Colors */
    --color-primary: #5D9CEC;
    /* Pastel Blue */
    --color-primary-hover: #4A89DC;
    /* Darker Pastel Hover */
    --color-danger: #ED8B8B;
    /* Pastel Red */
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text-main);
    line-height: 1.6;
}

/* ===== 공통 컨테이너 ===== */
.notion-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background-color: var(--color-bg);
    min-height: 100vh;
}

.notion-card {
    width: 100%;
    max-width: 450px;
    background: var(--color-card-bg);
    padding: 40px;
    border-radius: 20px;
    /* Softer corners */
    border: 1px solid var(--color-border);
    box-shadow: 0 10px 30px rgba(119, 133, 115, 0.08);
    /* Greenish shadow */
}

.card-top {
    padding: 24px;
    margin-bottom: 24px;
}

.card-bottom {
    padding-bottom: 32px;
}

/* ===== 타이틀 & 서브타이틀 ===== */
.title {
    font-size: 26px;
    font-weight: 700;
    color: var(--color-sub-green-2);
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 15px;
    color: var(--color-text-sub);
    margin-bottom: 32px;
}

/* ===== 입력 폼 ===== */
.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    font-size: 13px;
    color: var(--color-text-sub);
    margin-bottom: 8px;
    font-weight: 600;
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    background: #FDFDFB;
    font-size: 15px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    color: var(--color-text-main);
}

.input-group input:focus {
    outline: none;
    border-color: var(--color-sub-green-1);
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 103, 172, 0.15);
    /* Blue glow */
}

/* ===== 버튼 ===== */
#search-btn {
    width: 100%;
    padding: 16px;
    background-color: var(--color-primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 16px;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(119, 133, 115, 0.2);
}

#search-btn:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(119, 133, 115, 0.3);
}

#search-btn:disabled {
    background-color: var(--color-sub-green-1);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-external-link {
    display: block;
    width: 100%;
    padding: 16px;
    background-color: #EAF4FA;
    /* Soft Light Blue */
    color: var(--color-primary);
    border: 2px solid var(--color-sub-green-1);
    /* Softer Border */
    border-radius: 12px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    font-size: 16px;
    margin-bottom: 0;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(119, 133, 115, 0.1);
}

.btn-external-link:hover {
    background-color: var(--color-primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(119, 133, 115, 0.2);
}

/* ===== 태그 ===== */
.tag {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    /* Pill shape */
    font-weight: 600;
    display: inline-block;
}

/* Status Colors mapped to Palette */
.status-complete {
    background: #E3F2FD;
    /* Soft Blue */
    color: #4A90E2;
    /* Blue Text */
}

.status-pending {
    background: #F4F0E0;
    /* Very light beige */
    color: #8C8258;
    /* Darker beige text */
}

.status-new {
    background: #EBF0F2;
    /* Very light blue-grey */
    color: var(--color-point-grey);
}

/* ===== 기존 결과 카드 (로그인 페이지용) ===== */
.result-card {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px dashed var(--color-border);
}

.result-item {
    margin-bottom: 20px;
    text-align: left;
}

#my-question,
#admin-answer {
    margin-top: 12px;
    font-size: 15px;
    color: var(--color-text-main);
    line-height: 1.6;
}

/* ===== 목록 페이지 카드 ===== */
.list-card {
    max-width: 850px;
    /* Reduced width as requested */
}

.list-header {
    margin-bottom: 30px;
    text-align: center;
}

.list-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px dashed var(--color-border);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.footer-contact a {
    font-size: 13px;
    color: var(--color-text-sub);
    text-decoration: none;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 2px;
    transition: all 0.2s;
}

.footer-contact a:hover {
    color: var(--color-main-green);
    border-color: var(--color-main-green);
}

/* ===== 게시판 테이블 ===== */
.board-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--color-border);
}

.board-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.board-table thead {
    background: #EAF4FA;
    /* Light Blue Tint */
}

.board-table th {
    text-align: left;
    padding: 16px;
    font-weight: 700;
    color: var(--color-sub-green-2);
    font-size: 13px;
    border-bottom: 1px solid var(--color-border);
}

.board-table td {
    padding: 18px 16px;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

.board-table tbody tr:hover {
    background: #FAFBFA;
}

.col-status {
    width: 100px;
}

.col-date {
    width: 200px;
}

.col-action {
    width: 100px;
    text-align: center;
}

.date-cell {
    font-size: 13px;
    color: var(--color-text-sub);
    white-space: nowrap;
}

.content-cell {
    color: var(--color-text-main);
    line-height: 1.5;
}

.empty-message {
    text-align: center;
    color: var(--color-text-sub);
    padding: 60px !important;
}

/* ===== 버튼 스타일 ===== */
.btn-view {
    padding: 8px 16px;
    background: white;
    border: 1px solid var(--color-main-green);
    border-radius: 20px;
    color: var(--color-sub-green-2);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-view:hover {
    background: var(--color-main-green);
    color: white;
    border-color: var(--color-main-green);
}

.btn-secondary {
    padding: 10px 24px;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    color: var(--color-text-sub);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #F5F7F4;
    color: var(--color-sub-green-2);
    border-color: var(--color-sub-green-1);
}

/* ===== 모달 ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(84, 94, 84, 0.4);
    /* Dark Green Tint Overlay */
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    animation: modalSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 30px;
    border-bottom: 1px solid var(--color-border);
    background: #FDFDFB;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-sub-green-2);
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    font-size: 28px;
    color: var(--color-text-sub);
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: #F0F2F0;
    color: var(--color-sub-green-2);
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    max-height: calc(85vh - 85px);
}

.detail-section {
    margin-bottom: 28px;
}

.detail-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.detail-date {
    font-size: 14px;
    color: var(--color-text-sub);
}

.detail-label {
    display: block;
    font-size: 13px;
    color: var(--color-sub-green-2);
    font-weight: 700;
    margin-bottom: 10px;
}

.detail-box {
    padding: 20px;
    border-radius: 12px;
    font-size: 15px;
    line-height: 1.7;
    white-space: pre-wrap;
}

.question-box {
    background: #FAFBFA;
    border: 1px solid var(--color-border);
    color: var(--color-text-main);
}

.answer-box {
    background: #EEF6FC;
    /* Light Blue Tint */
    border: 1px solid #DDEAF4;
    color: var(--color-text-main);
}

/* ===== 반응형 ===== */
/* ===== 반응형 (모바일 최적화) ===== */
@media (max-width: 600px) {
    .notion-card {
        padding: 24px 20px;
        width: 100%;
        max-width: 92%;
    }

    /* Input Zoom Fix for iOS */
    .input-group input {
        font-size: 16px;
    }

    /* Table to Card Transformation */
    .board-table thead {
        display: none;
    }

    .board-table,
    .board-table tbody,
    .board-table tr,
    .board-table td {
        display: block;
        width: 100%;
    }

    .board-table tr {
        background: white;
        border: 1px solid var(--color-border);
        border-radius: 12px;
        margin-bottom: 12px;
        padding: 16px;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        position: relative;
    }

    .board-table td {
        border: none;
        padding: 0;
    }

    /* Status: Top Left pill */
    .col-status {
        width: auto;
        order: 1;
        margin-bottom: 4px;
    }

    /* Date: Top Right (Restore display) */
    .col-date {
        display: block;
        width: auto;
        order: 2;
        margin-left: auto;
        /* Push to right */
        font-size: 12px;
        color: var(--color-text-sub);
    }

    /* Content: Full width below status/date */
    .col-content {
        width: 100%;
        order: 3;
        font-size: 15px;
        font-weight: 600;
        margin-top: 4px;
        margin-bottom: 12px;
        color: var(--color-text-main);
        /* 텍스트 말줄임 처리 (2줄) */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Action: Full width button at bottom */
    .col-action {
        width: 100%;
        order: 4;
        text-align: center;
    }

    .btn-view {
        width: 100%;
        padding: 10px;
        background: #F5F7F4;
        border: 1px solid var(--color-border);
        color: var(--color-sub-green-2);
    }

    .btn-view:hover {
        background: var(--color-main-green);
        color: white;
    }
}

/* ===== 에러 모달 스타일 ===== */
.error-content {
    max-width: 360px;
    text-align: center;
    background: white;
    padding: 0;
}

.error-body {
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.error-title {
    font-size: 18px;
    font-weight: 700;
    color: #E05A5A;
    /* Red */
    margin-bottom: 10px;
}

.error-msg {
    font-size: 14px;
    color: var(--color-text-sub);
    margin-bottom: 24px;
}

.contact-link-box {
    margin-top: 10px;
}

#contact-admin-link {
    font-size: 13px;
    color: var(--color-text-sub);
    text-decoration: none;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 2px;
    transition: all 0.2s;
}

#contact-admin-link:hover {
    color: var(--color-main-green);
    border-color: var(--color-main-green);
}