/* ========================================
   Contact 페이지 전용 스타일
   ======================================== */

/* 연락처 정보 그리드 */
.contact-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-3xl);
}

@media (max-width: 768px) {
    .contact-info-grid {
        grid-template-columns: 1fr;
    }
}

.contact-card {
    text-align: center;
    padding: var(--spacing-2xl);
    background: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border-top: 3px solid transparent;
    position: relative;
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-top-color: var(--primary-color);
}

.contact-icon {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-lg);
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fff4e6, #ffe8cc);
    color: var(--primary-color);
    border-radius: 50%;
    margin-left: auto;
    margin-right: auto;
}

.contact-card h3 {
    font-size: var(--font-xl);
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.contact-card p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    font-size: var(--font-base);
}

.contact-link {
    display: inline-block;
    color: var(--primary-color);
    font-weight: 600;
    font-size: var(--font-xs);
    text-decoration: none;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
    max-width: 100%;
    text-align: center;
}

.contact-link:hover {
    background: var(--primary-color);
    color: var(--text-white);
}

/* 문의 폼 래퍼 */
.contact-form-wrapper {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-white);
    padding: var(--spacing-3xl);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

/* 폼 스타일 */
.contact-form {
    width: 100%;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
    color: var(--text-primary);
    font-size: var(--font-base);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: var(--spacing-md);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: var(--font-base);
    font-family: inherit;
    transition: var(--transition);
    background: var(--bg-white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 136, 0, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

.form-group select {
    cursor: pointer;
}

/* 체크박스 그룹 */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    cursor: pointer;
    line-height: 1.5;
    font-size: var(--font-sm);
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-muted);
    border-radius: 4px;
    position: relative;
    flex-shrink: 0;
    background: var(--bg-white);
    transition: var(--transition);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-white);
    font-size: 12px;
    font-weight: bold;
}

.privacy-link {
    color: var(--primary-color);
    text-decoration: underline;
    font-size: var(--font-xs);
    margin-left: auto;
}

.privacy-link:hover {
    color: var(--secondary-color);
}

/* 필드 힌트 */
.field-hint {
    color: #ef4444;
    font-size: var(--font-xs);
    margin-top: 0.375rem;
    margin-bottom: 0;
}

/* 비활성 제출 버튼 */
.btn-submit-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* API 에러 폴백 오버레이 */
.api-error-fallback {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
}

.api-error-content {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    max-width: 480px;
    width: 100%;
    padding: var(--spacing-2xl);
    text-align: center;
    position: relative;
}

.api-error-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
}

.api-error-close:hover {
    color: var(--primary-color);
}

.api-error-icon {
    font-size: 3rem;
    color: #ef4444;
    margin-bottom: var(--spacing-md);
}

.api-error-content h3 {
    margin: 0 0 var(--spacing-sm);
    color: var(--text-primary);
}

.api-error-content > p {
    color: var(--text-secondary);
    font-size: var(--font-sm);
    margin-bottom: var(--spacing-xl);
}

.api-error-contacts {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.api-error-method {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
}

.api-error-method:hover {
    border-color: var(--primary-color);
    background: rgba(255, 136, 0, 0.05);
}

.api-error-method i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
    color: var(--primary-color);
}

.api-error-method div {
    text-align: left;
}

.api-error-method strong {
    display: block;
    font-size: var(--font-sm);
}

.api-error-method span {
    font-size: var(--font-xs);
    color: var(--text-secondary);
}

/* 다크모드 API 에러 */
[data-theme="dark"] .api-error-content {
    background: var(--dark-bg-secondary);
}

[data-theme="dark"] .api-error-content h3 {
    color: var(--dark-text-primary);
}

[data-theme="dark"] .api-error-content > p {
    color: var(--dark-text-secondary);
}

[data-theme="dark"] .api-error-method {
    border-color: var(--dark-border);
    color: var(--dark-text-primary);
}

[data-theme="dark"] .api-error-method:hover {
    background: rgba(255, 136, 0, 0.1);
}

[data-theme="dark"] .api-error-method span {
    color: var(--dark-text-secondary);
}

/* 개인정보 요약 */
.privacy-summary {
    background: var(--bg-light, #f8f9fa);
    border-radius: var(--border-radius-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    font-size: var(--font-xs);
    color: var(--text-secondary);
    border-left: 3px solid var(--primary-color);
}

.privacy-summary ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.privacy-summary li {
    margin-bottom: var(--spacing-xs);
    line-height: 1.5;
}

.privacy-summary li:last-child {
    margin-bottom: 0;
}

/* 필수 표시 */
.required {
    color: #ef4444;
}

[data-theme="dark"] .privacy-summary {
    background: rgba(255, 255, 255, 0.04);
    border-left-color: var(--primary-color);
    color: var(--dark-text-tertiary);
}

/* 폼 제출 버튼 */
.form-submit {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    margin-top: var(--spacing-2xl);
}

/* 위치 정보 */
.location-wrapper {
    margin-top: var(--spacing-2xl);
}

.location-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-3xl);
    align-items: start;
    background: var(--bg-white);
    padding: var(--spacing-2xl);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.location-details h3 {
    color: var(--text-primary);
    margin: var(--spacing-xl) 0 var(--spacing-sm);
    font-size: var(--font-lg);
}

.location-details h3 i {
    color: var(--primary-color);
    width: 20px;
    text-align: center;
    margin-right: var(--spacing-xs);
}

.location-details h3:first-child {
    margin-top: 0;
}

.location-details ul {
    list-style: none;
    padding: 0;
}

.location-details li {
    margin-bottom: var(--spacing-sm);
    padding-left: var(--spacing-md);
    position: relative;
    line-height: 1.5;
}

.location-details li::before {
    content: '•';
    color: var(--primary-color);
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* 지도 컨테이너 */
.location-map {
    position: sticky;
    top: var(--spacing-xl);
}

.map-container {
    width: 100%;
    height: 350px;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-lg);
}

.map-placeholder {
    width: 100%;
    height: 100%;
    background: var(--bg-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    text-align: center;
    padding: var(--spacing-xl);
    border: 2px dashed var(--primary-color);
    border-radius: var(--border-radius);
}

.map-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-lg);
    color: var(--primary-color);
}

.map-placeholder h4 {
    font-size: var(--font-xl);
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.map-placeholder p {
    line-height: 1.6;
    color: var(--text-secondary);
}

/* 구글 맵 임베드 스타일 */
.map-container iframe {
    border-radius: var(--border-radius);
}

.map-buttons {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
}

.map-buttons .btn {
    flex: 1;
    text-align: center;
    font-size: var(--font-sm);
}

/* 개인정보처리방침 모달 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1100;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    max-width: 600px;
    max-height: 80vh;
    width: 90%;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
}

.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-xl);
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.modal-close {
    font-size: var(--font-2xl);
    cursor: pointer;
    color: var(--text-secondary);
    background: none;
    border: none;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal-body {
    padding: var(--spacing-xl);
}

.modal-body h4 {
    color: var(--primary-color);
    margin: var(--spacing-lg) 0 var(--spacing-sm);
}

.modal-body h4:first-child {
    margin-top: 0;
}

.modal-body ul {
    margin-bottom: var(--spacing-md);
    padding-left: var(--spacing-lg);
}

.modal-body li {
    margin-bottom: var(--spacing-xs);
}

/* CTA 섹션 */
.cta-buttons {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    flex-wrap: wrap;
    margin-top: var(--spacing-xl);
}

/* 반응형 디자인 */
@media (min-width: 769px) and (max-width: 1024px) {
    .contact-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .contact-info-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .contact-form-wrapper {
        padding: var(--spacing-xl);
        margin: 0 var(--spacing-md);
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .location-info {
        grid-template-columns: 1fr;
        gap: var(--spacing-2xl);
    }

    .location-map {
        position: static;
    }

    .form-submit {
        flex-direction: column;
    }

    .form-submit .btn {
        width: 100%;
    }

    .modal-content {
        width: 95%;
        margin: var(--spacing-md);
    }

    .modal-header,
    .modal-body {
        padding: var(--spacing-lg);
    }
}

@media (max-width: 480px) {
    .contact-card {
        padding: var(--spacing-lg);
    }

    .contact-icon {
        font-size: 1.3rem;
        width: 48px;
        height: 48px;
    }

    .contact-card h3 {
        font-size: var(--font-lg);
    }

    .contact-link {
        font-size: var(--font-base);
        padding: var(--spacing-sm);
    }

    .map-container {
        height: 250px;
    }

    .map-buttons {
        flex-direction: column;
    }

    .checkbox-group {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .privacy-link {
        margin-left: 0;
        margin-top: var(--spacing-xs);
    }
}

/* ========================================
   다크모드
   ======================================== */
[data-theme="dark"] .page-header {
    background: var(--dark-header-gradient);
}

[data-theme="dark"] .contact-card {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-top: 3px solid transparent;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .contact-card:hover {
    border-color: rgba(255, 136, 0, 0.3);
    border-top-color: var(--primary-color);
    box-shadow: 0 8px 32px rgba(255, 136, 0, 0.1);
}

[data-theme="dark"] .contact-card h3 {
    color: var(--dark-text-primary);
}

[data-theme="dark"] .contact-card p {
    color: var(--dark-text-tertiary);
}

[data-theme="dark"] .contact-icon {
    background: rgba(255, 136, 0, 0.12);
    color: var(--primary-color);
}

[data-theme="dark"] .contact-link {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

[data-theme="dark"] .contact-link:hover {
    background: var(--primary-color);
    color: var(--text-white);
}

/* 위치 정보 텍스트 */
[data-theme="dark"] .location-details li {
    color: var(--dark-text-secondary);
}

/* 맵 플레이스홀더 */
[data-theme="dark"] .map-placeholder {
    background: var(--dark-surface);
    border-color: rgba(255, 136, 0, 0.3);
}

[data-theme="dark"] .map-placeholder h4 {
    color: var(--dark-text-primary);
}

[data-theme="dark"] .map-placeholder p {
    color: var(--dark-text-tertiary);
}

[data-theme="dark"] .contact-form-wrapper {
    background: var(--dark-surface);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .form-group label {
    color: var(--dark-text-secondary);
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--glass-border);
    color: var(--dark-text-primary);
}

[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-group select:focus,
[data-theme="dark"] .form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 136, 0, 0.15);
}

[data-theme="dark"] .form-group input::placeholder,
[data-theme="dark"] .form-group textarea::placeholder {
    color: var(--dark-text-disabled);
}

[data-theme="dark"] .checkbox-label {
    color: var(--dark-text-secondary);
}

[data-theme="dark"] .location-info {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .location-details h3 {
    color: var(--dark-text-primary);
}

[data-theme="dark"] .location-details p,
[data-theme="dark"] .location-details li {
    color: var(--dark-text-secondary);
}

[data-theme="dark"] .map-container {
    border-color: transparent;
    box-shadow: none;
}

[data-theme="dark"] .modal-content {
    background: var(--dark-surface);
    border: 1px solid var(--glass-border);
    color: var(--dark-text-secondary);
}

[data-theme="dark"] .cta-section {
    background: var(--dark-header-gradient);
}

/* 체크박스 마크 */
[data-theme="dark"] .checkmark {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

/* 모달 헤더 */
[data-theme="dark"] .modal-header {
    border-bottom-color: var(--glass-border);
}

[data-theme="dark"] .modal-header h3 {
    color: var(--dark-text-primary);
}

[data-theme="dark"] .modal-close {
    color: var(--dark-text-tertiary);
}

[data-theme="dark"] .modal-close:hover {
    color: var(--dark-text-primary);
}

[data-theme="dark"] .modal-body h4 {
    color: var(--dark-text-primary);
}

[data-theme="dark"] .modal-body p,
[data-theme="dark"] .modal-body li {
    color: var(--dark-text-secondary);
}

/* ========================================
   접근성: prefers-reduced-motion
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    .field-error,
    .notification,
    .modal {
        animation: none !important;
        transition: none !important;
    }
}

/* ========================================
   접근성: focus-visible 상태
   ======================================== */
.form-group input:focus-visible,
.form-group select:focus-visible,
.form-group textarea:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 1px;
}

.modal-close:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ========================================
   폼 유효성 검사 스타일
   ======================================== */
.form-group input.error,
.form-group select.error,
.form-group textarea.error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.field-error {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.notification {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}