@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard-dynamic-subset.min.css');

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --success: #10b981;
    --success-hover: #059669;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --bg-app: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.95);
    --border-color: #e2e8f0;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
}

body {
    background-color: var(--bg-app);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Header Styling */
header {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    color: #ffffff;
    padding: 2.5rem 1rem;
    text-align: center;
    position: relative;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #60a5fa, #34d399);
}

header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 0.5rem;
    animation: fadeInDown 0.6s ease-out;
}

header p {
    font-size: 1rem;
    color: #bfdbfe;
    font-weight: 400;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

/* Main Container */
main {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 0 1rem 3rem 1rem;
    flex: 1;
}

/* Card Styling */
.card {
    background: var(--card-bg);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-xl);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-left: 4px solid var(--primary);
    padding-left: 0.75rem;
}

/* Markdown Document View */
.document-container {
    max-height: 350px;
    overflow-y: auto;
    overflow-x: auto;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: #ffffff;
    font-size: 0.95rem;
    color: #334155;
    margin-bottom: 1rem;
}

/* Custom Scrollbar */
.document-container::-webkit-scrollbar {
    width: 6px;
}
.document-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}
.document-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
.document-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Markdown inside styling */
.document-container h1 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #0f172a;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}
.document-container h2 {
    font-size: 1.1rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: #1e293b;
}
.document-container p {
    margin-bottom: 0.8rem;
    text-align: justify;
    word-break: keep-all;
}
.document-container ul, .document-container ol {
    margin-left: 1.5rem;
    margin-bottom: 0.8rem;
}
.document-container table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.85rem;
}
.document-container th, .document-container td {
    border: 1px solid var(--border-color);
    padding: 6px 10px;
    text-align: left;
    white-space: nowrap;
    word-break: keep-all;
}
.document-container th {
    background-color: var(--primary-light);
    color: #1e3a8a;
    font-weight: 600;
}

/* Form Controls */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.5rem;
}

/* Dropdown Grid */
.dropdown-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

@media (max-width: 600px) {
    .dropdown-grid {
        grid-template-columns: 1fr;
    }
}

select, input[type="text"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: #ffffff;
    font-size: 0.95rem;
    color: var(--text-main);
    outline: none;
    transition: all 0.2s ease;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}

select:focus, input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

select:disabled {
    background-color: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

/* Custom Checkbox Section */
.checkbox-container {
    display: flex;
    align-items: center;
    background-color: var(--primary-light);
    border: 1px solid rgba(37, 99, 235, 0.15);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin: 2rem 0 1.5rem 0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.checkbox-container:hover {
    background-color: #e0f2fe;
    border-color: rgba(37, 99, 235, 0.3);
}

.checkbox-container input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    height: 24px;
    width: 24px;
    background-color: #ffffff;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    margin-right: 12px;
    position: relative;
    transition: all 0.2s cubic-bezier(0.12, 0.4, 0.29, 1.46);
    flex-shrink: 0;
}

.checkbox-container:hover input ~ .checkmark {
    border-color: var(--primary);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
    transform: scale(1.05);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 8px;
    top: 3px;
    width: 5px;
    height: 11px;
    border: solid white;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e3a8a;
    user-select: none;
}

/* Submit Button */
.btn-submit {
    display: block;
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
    transition: all 0.2s ease;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.3);
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
}

.btn-submit:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

/* Admin Dashboard Table */
.admin-search-box {
    margin-bottom: 2rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #ffffff;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

.data-table th {
    background-color: #0f172a;
    color: #ffffff;
    font-weight: 600;
    padding: 1rem 1.5rem;
    white-space: nowrap;
}

.data-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    white-space: nowrap;
}

.data-table tbody tr {
    transition: background-color 0.2s ease;
}

.data-table tbody tr:hover {
    background-color: var(--primary-light);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.empty-message {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Survey Link Button */
.btn-survey {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    background-color: var(--success);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.1);
}

.btn-survey:hover {
    background-color: var(--success-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.2);
}

/* Modal Popup */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 2.5rem 2rem;
    max-width: 450px;
    width: 90%;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-icon {
    width: 64px;
    height: 64px;
    background-color: #d1fae5;
    color: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1.5rem auto;
}

.modal-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.75rem;
}

.modal-text {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.btn-close-modal {
    padding: 0.75rem 2rem;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-close-modal:hover {
    background-color: var(--primary-hover);
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Footer style */
footer {
    text-align: center;
    padding: 2rem 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    background-color: #ffffff;
}

/* 모바일 전용 반응형 대시보드 테이블 튜닝 */
@media (max-width: 600px) {
    /* 테이블 글씨 및 패딩 최적화 */
    .data-table th, .data-table td {
        padding: 0.75rem 0.4rem;
        font-size: 0.8rem;
    }
    
    /* 4번째 열(동의 일시) 숨김 처리하여 모바일 공간 확보 */
    .data-table th:nth-child(4),
    .data-table td:nth-child(4) {
        display: none;
    }
    
    /* 조사참여하기 버튼 크기 조밀화 */
    .btn-survey {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
        border-radius: 4px;
    }
    
    /* 모바일 카드 안 여백 미세 조절 */
    .card {
        padding: 1.25rem 0.75rem;
    }
}

