/* mobile-survey.css - 모바일 조사페이지 전용 CSS */

/* 탭 네비게이션 */
.m-survey-tabs {
    display: flex;
    background: var(--m-bg-panel);
    border-radius: 0.5rem;
    padding: 0.25rem;
    margin-bottom: 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.m-survey-tab {
    flex: 1;
    min-width: max-content;
    padding: 0.625rem 0.75rem;
    text-align: center;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--m-text-secondary);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.m-survey-tab.active {
    background: var(--m-accent);
    color: white;
    font-weight: 600;
}

.m-survey-tab:not(.active):hover {
    background: rgba(255, 255, 255, 0.05);
}

/* 조사상태 카드 */
.m-survey-status-card {
    background: var(--m-bg-panel);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--m-border-panel);
}

.m-survey-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.m-survey-status-label {
    font-size: 0.75rem;
    color: var(--m-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.m-survey-status-current {
    font-size: 0.875rem;
    color: var(--m-text-primary);
}

.m-survey-status-current strong {
    font-weight: 700;
    color: var(--m-accent);
}

.m-survey-status-btns {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.m-survey-status-btn {
    flex: 1;
    min-width: 70px;
    padding: 0.5rem 0.75rem;
    border: 2px solid transparent;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.08);
    color: var(--m-text-secondary);
}

.m-survey-status-btn.active {
    border-color: var(--m-accent);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35);
}

.m-survey-status-btn.status-pending {
    background: rgba(156, 163, 175, 0.3);
    color: #9ca3af;
}

.m-survey-status-btn.status-pending.active {
    background: #6b7280;
    color: white;
}

.m-survey-status-btn.status-hope {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.m-survey-status-btn.status-hope.active {
    background: #f59e0b;
    color: white;
}

.m-survey-status-btn.status-done {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.m-survey-status-btn.status-done.active {
    background: #16a34a;
    color: white;
}

.m-survey-status-btn.status-unknown {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.m-survey-status-btn.status-unknown.active {
    background: #dc2626;
    color: white;
}

/* 섹션 스타일 */
.m-survey-section {
    margin-bottom: 1.5rem;
}

.m-survey-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--m-text-primary);
    margin-bottom: 0.75rem;
}

.m-survey-section-title .material-symbols-outlined {
    font-size: 1.125rem;
    color: var(--m-accent);
}

/* 정보 그리드 */
.m-survey-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.m-survey-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.m-survey-info-item.full-width {
    grid-column: 1 / -1;
}

.m-survey-info-label {
    font-size: 0.6875rem;
    color: var(--m-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.m-survey-info-value {
    font-size: 0.875rem;
    color: var(--m-text-primary);
}

/* 입력 필드 */
.m-survey-field {
    margin-bottom: 0.875rem;
}

.m-survey-field label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--m-text-secondary);
    margin-bottom: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.025rem;
}

.m-survey-field input,
.m-survey-field select,
.m-survey-field textarea {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--m-border);
    border-radius: 0.5rem;
    background: var(--m-bg-secondary);
    color: var(--m-text-primary);
    font-size: 0.875rem;
    box-sizing: border-box;
    min-height: 2.75rem;
}

.m-survey-field input::placeholder,
.m-survey-field textarea::placeholder {
    color: var(--m-text-muted);
}

.m-survey-field input:focus,
.m-survey-field select:focus,
.m-survey-field textarea:focus {
    outline: none;
    border-color: var(--m-accent);
}

/* 사진 그리드 */
.m-survey-photos-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.m-survey-photo-item {
    cursor: pointer;
}

.m-survey-photo-label {
    font-size: 0.6875rem;
    text-align: center;
    margin-bottom: 0.375rem;
    color: var(--m-text-secondary);
}

.m-survey-photo-box {
    aspect-ratio: 4 / 3;
    background: var(--m-bg-panel);
    border: 1px solid var(--m-border-panel);
    border-radius: 0.5rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.m-survey-photo-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.m-survey-photo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: var(--m-text-muted);
}

.m-survey-photo-placeholder .material-symbols-outlined {
    font-size: 2rem;
}

.m-survey-photo-placeholder span:last-child {
    font-size: 0.6875rem;
}

.m-survey-photo-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.m-survey-photo-box:hover .m-survey-photo-overlay {
    opacity: 1;
}

.m-survey-photo-overlay .material-symbols-outlined {
    color: white;
    font-size: 1.5rem;
}

/* 테이블 스타일 */
.m-survey-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -1rem;
    padding: 0 1rem;
}

.m-survey-table {
    width: 100%;
    min-width: 400px;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.m-survey-table th,
.m-survey-table td {
    padding: 0.625rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--m-border);
}

.m-survey-table th {
    font-weight: 600;
    color: var(--m-text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    background: var(--m-bg-secondary);
}

.m-survey-table td {
    color: var(--m-text-primary);
}

.m-survey-table tr:last-child td {
    border-bottom: none;
}

/* 빈 상태 */
.m-survey-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--m-text-muted);
    gap: 0.5rem;
}

.m-survey-empty .material-symbols-outlined {
    font-size: 2.5rem;
    opacity: 0.5;
}

/* 버튼 스타일 */
.m-survey-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.625rem 1rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.m-survey-btn-primary {
    background: var(--m-accent);
    color: white;
}

.m-survey-btn-primary:hover {
    background: var(--m-accent-hover);
}

.m-survey-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.m-survey-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--m-text-primary);
}

.m-survey-btn-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.m-survey-btn-danger:hover {
    background: #dc2626;
    color: white;
}

.m-survey-btn-block {
    width: 100%;
}

/* 피드백 메시지 */
.m-survey-feedback {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.m-survey-feedback-success {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.5);
    color: #4ade80;
}

.m-survey-feedback-error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fca5a5;
}

/* 인라인 토스트 (저장 버튼 위) */
.m-survey-toast-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    margin-top: 1.5rem;
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.5);
    border-radius: 0.5rem;
    color: #4ade80;
    font-size: 0.875rem;
    font-weight: 500;
    animation: m-toast-fade-in 0.3s ease-out;
}

.m-survey-toast-inline .material-symbols-outlined {
    font-size: 1.125rem;
}

@keyframes m-toast-fade-in {
    from {
        opacity: 0;
        transform: translateY(-0.5rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 스피너 */
.m-survey-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: m-survey-spin 1s linear infinite;
}

@keyframes m-survey-spin {
    to { transform: rotate(360deg); }
}

/* 모달 */
.m-survey-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.m-survey-modal {
    position: fixed;
    z-index: 1001;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--m-bg-panel);
    border-radius: 0.75rem;
    width: calc(100% - 2rem);
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.m-survey-modal-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.m-survey-modal-body {
    padding: 1rem;
}

.m-survey-modal-footer {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 1px solid var(--m-border);
}

.m-survey-modal-footer .m-survey-btn {
    flex: 1;
}

/* 사진 선택 옵션 */
.m-survey-photo-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.m-survey-photo-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--m-bg-secondary);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.2s;
}

.m-survey-photo-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.m-survey-photo-option .material-symbols-outlined {
    font-size: 1.5rem;
    color: var(--m-accent);
}

.m-survey-photo-option input[type="file"] {
    display: none;
}

/* 검침데이터 입력 폼 */
.m-survey-reading-form {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.m-survey-reading-form select,
.m-survey-reading-form input {
    flex: 1;
    min-width: 80px;
    padding: 0.625rem;
    border: 1px solid var(--m-border);
    border-radius: 0.5rem;
    background: var(--m-bg-secondary);
    color: var(--m-text-primary);
    font-size: 0.875rem;
}

.m-survey-reading-form button {
    padding: 0.625rem 1rem;
}

/* 호폐기록 카드 */
.m-survey-hope-card {
    background: var(--m-bg-panel);
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--m-border-panel);
}

.m-survey-hope-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.m-survey-hope-date {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--m-text-primary);
}

.m-survey-hope-author {
    font-size: 0.75rem;
    color: var(--m-text-muted);
}

.m-survey-hope-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.m-survey-hope-remarks {
    font-size: 0.8125rem;
    color: var(--m-text-secondary);
    line-height: 1.4;
}

.m-survey-hope-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--m-border);
}

.m-survey-hope-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.375rem;
    border: none;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    cursor: pointer;
    background: transparent;
}

.m-survey-hope-action-btn.edit {
    color: var(--m-accent);
}

.m-survey-hope-action-btn.delete {
    color: #ef4444;
}

/* 이미지 전체화면 모달 */
.m-survey-image-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.m-survey-image-modal img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.m-survey-image-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
}

/* 토스트 메시지 (저장 완료 등) */
.m-survey-toast {
    position: fixed;
    bottom: 5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1200;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: rgba(30, 41, 59, 0.98);
    border: 1px solid rgba(34, 197, 94, 0.5);
    border-radius: 0.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    color: #4ade80;
    font-size: 0.9375rem;
    font-weight: 500;
    animation: m-survey-toast-in 0.3s ease-out;
}

.m-survey-toast .material-symbols-outlined {
    font-size: 1.25rem;
    color: #4ade80;
}

@keyframes m-survey-toast-in {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(1rem);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* 지도 줌 컨트롤 */
.m-map-zoom-controls {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    background: var(--m-bg-panel);
    border-radius: 0.5rem;
    padding: 0.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.m-map-zoom-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--m-text-primary);
    border-radius: 0.375rem;
    cursor: pointer;
}

.m-map-zoom-btn:active {
    background: rgba(255, 255, 255, 0.1);
}

.m-map-zoom-btn .material-symbols-outlined {
    font-size: 1.25rem;
}

.m-map-zoom-level {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--m-accent);
    padding: 0.25rem 0;
    border-top: 1px solid var(--m-border);
    border-bottom: 1px solid var(--m-border);
}
