/* 비즈니스 전용 스타일 - 전문적이고 깔끔한 사무용 프로그램 느낌 */

:root {
    /* 네이버 시그니처 컬러 팔레트 */
    --primary-color: #03c75a;  /* 네이버 그린 */
    --secondary-color: #2db400; /* 진한 초록 */
    --accent-color: #4a90e2;   /* 차분한 파랑 */
    --success-color: #03c75a;  /* 네이버 그린 */
    --warning-color: #f39c12;  /* 차분한 주황 */
    --danger-color: #c0392b;   /* 차분한 빨강 */
    
    /* 배경 색상 */
    --bg-primary: #ffffff;
    --bg-secondary: #f7f8fa;
    --bg-tertiary: #e8ecf0;
    
    /* 텍스트 색상 */
    --text-primary: #2c3e50;
    --text-secondary: #5f6d7e;
    --text-muted: #8492a6;
    
    /* 보더 색상 */
    --border-color: #d5dae1;
    --border-light: #e8ecf0;
    
    /* 그림자 */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 8px rgba(0,0,0,0.1);
}

/* 전체 스타일 리셋 - 사무적인 느낌 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Malgun Gothic', -apple-system, sans-serif;
    color: var(--text-primary);
    background: var(--bg-secondary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* 레이아웃 */
#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.main-container {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* 지도 컨테이너 */
.map-container {
    flex: 1;
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
}

/* 헤더 - 깔끔하고 전문적인 스타일 */
.header {
    background: #000000;
    color: white;
    padding: 0.75rem 1.5rem;
    box-shadow: var(--shadow-md);
    border-bottom: 1px solid rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    position: relative;
}

.header h1 {
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: -0.5px;
    margin: 0;
    position: static;
    left: auto;
    transform: none;
}

.header-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin: 0 auto;
    justify-content: center;
}

/* 지도 타입 선택 버튼 - 탭 스타일 */
.map-type-selector {
    display: flex;
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
}

.map-type-btn {
    padding: 0.4rem 0.8rem;
    background: transparent;
    color: rgba(255,255,255,0.8);
    border: none;
    border-right: 1px solid rgba(255,255,255,0.2);
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.2s;
}

.map-type-btn:last-child {
    border-right: none;
}

.map-type-btn:hover {
    background: rgba(255,255,255,0.1);
}

.map-type-btn.active {
    background: rgba(255,255,255,0.2);
    color: white;
    font-weight: 500;
}

/* 검색 바 - 미니멀한 디자인 */
.search-container {
    display: flex;
    gap: 0.5rem;
    max-width: 400px;
}

#searchInput {
    flex: 1;
    padding: 0.4rem 0.8rem;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.9);
    border-radius: 2px;
    font-size: 0.85rem;
    color: var(--text-primary);
}

#searchInput:focus {
    outline: none;
    background: white;
    border-color: rgba(255,255,255,0.5);
}

#searchBtn {
    padding: 0.4rem 1rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
}

#searchBtn:hover {
    background: #3a7bc8;
}

/* 검색 토글 버튼 */
.search-toggle-btn {
    padding: 0.4rem 1rem;
    background: var(--warning-color);
    color: white;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    margin-left: 0.5rem;
    transition: all 0.2s ease;
}

.search-toggle-btn:hover {
    background: #e67e22;
}

.search-toggle-btn.active {
    background: var(--success-color);
}

.search-toggle-btn.active:hover {
    background: var(--secondary-color);
}

/* 사이드바 - 클린한 디자인 */
.sidebar {
    width: 320px;
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.sidebar::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* 색상 패널 - 심플하게 */
.color-panel {
    background: white;
    border-bottom: 1px solid var(--border-light);
    padding: 1rem;
}

.color-panel h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.color-palette {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.color-item {
    height: 32px;
    border-radius: 2px;
    cursor: pointer;
    border: 1px solid var(--border-color);
    transition: transform 0.1s;
}

.color-item:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.color-item.active {
    border: 2px solid var(--accent-color);
    box-shadow: 0 0 0 1px var(--accent-color);
}

/* 검색 필지용 보라색 스타일 제거 - 왼쪽 팔레트에서는 사용하지 않음 */

/* 필지 정보 폼 - 테이블 형식 */
.parcel-info {
    background: white;
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.parcel-info h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.85rem;
}

.form-group label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #334155;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.45rem 0.5rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.88rem;
    background: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
    background: #ffffff;
}

/* 버튼 영역 - 행정용 톤 다운 */
.form-actions {
    margin-top: 1.2rem;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
    padding-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.form-actions-primary {
    display: flex;
    gap: 0.6rem;
}

.form-actions-primary button {
    flex: 1;
    min-width: 90px;
    padding: 0.65rem 0.8rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all 0.2s ease;
    color: #1f2933;
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.96), rgba(237, 242, 247, 0.94));
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
}

.form-actions-primary button:hover {
    transform: translateY(-1px);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

#clearBtn:hover {
    background: #a93226;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(192, 57, 43, 0.3);
}

/* 색상 액션 버튼 그룹 */
.color-actions {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.color-actions button {
    flex: 1;
    padding: 0.4rem;
    font-size: 0.7rem;
    border-radius: 10px;
    border: 1px solid;
    font-weight: 500;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.3s;
}

#clearSelectedBtn {
    background: linear-gradient(90deg, #FF0000, #FFA500, #FFFF00, #90EE90, #0000FF, #000000, #FFFFFF, #87CEEB);
    color: white;
    border: 2px solid transparent;
    background-clip: padding-box;
    position: relative;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

#clearSelectedBtn::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(90deg, #FF0000, #FFA500, #FFFF00, #90EE90, #0000FF, #000000, #FFFFFF, #87CEEB);
    border-radius: 10px;
    z-index: -1;
    opacity: 0.3;
}

#clearSelectedBtn:hover {
    background: linear-gradient(90deg, #FF0000, #FFA500, #FFFF00, #90EE90, #0000FF, #000000, #FFFFFF, #87CEEB);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0.9;
}

#clearSearchBtn {
    background: #9370DB;
    color: white;
    border-color: #9370DB;
}

#clearSearchBtn:hover {
    background: #7B5FBD;
    color: white;
    box-shadow: 0 2px 8px rgba(147, 112, 219, 0.3);
    transform: scale(1.05);
}

/* 내보내기 버튼 그룹 */
.export-buttons {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.export-buttons button {
    flex: 1;
    padding: 0.6rem;
    font-size: 0.8rem;
    border-radius: 12px;
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    min-height: 44px; /* 버튼 최소 높이 고정 */
}

#exportCurrentBtn {
    background: linear-gradient(135deg, #34a853 0%, #0d8043 100%);
    color: white;
    border: none;
}

#exportCurrentBtn:hover {
    background: linear-gradient(135deg, #2e9447 0%, #0a6636 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(52, 168, 83, 0.3);
}

#copyDataBtn {
    background: linear-gradient(135deg, #2b579a 0%, #1e3a6f 100%);
    color: white;
    border: none;
}

#copyDataBtn:hover {
    background: linear-gradient(135deg, #234a87 0%, #18305c 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(43, 87, 154, 0.3);
}

/* 필지 관리 시스템 패널 - 엔터프라이즈 스타일 */
.advanced-panel {
    background: white;
    box-shadow: -2px 0 8px rgba(0,0,0,0.1);
    border-left: 1px solid var(--border-color);
}

/* 필지 관리 액션 버튼 */
.pm-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.pm-actions button {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: 2px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-export {
    background: var(--accent-color);
    color: white;
}

.btn-export:hover {
    background: #3a7bc8;
}

.btn-export-google {
    background: #0F9D58;
    color: white;
}

.btn-export-google:hover {
    background: #0C7E45;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #a02820;
}

.ap-toggle {
    background: var(--primary-color);
    border-radius: 2px 0 0 2px;
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999;
    box-shadow: -2px 0 4px rgba(0,0,0,0.1);
}

.ap-toggle-icon {
    color: white;
    font-size: 1.2rem;
}

.ap-toggle-text {
    color: white;
    font-size: 0.7rem;
    font-weight: 500;
    writing-mode: vertical-lr;
    text-orientation: upright;
    margin-top: 0.3rem;
    letter-spacing: 0.1rem;
}

.ap-toggle-count {
    background: white;
    color: var(--primary-color);
    padding: 0.2rem 0.4rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.ap-header {
    background: var(--primary-color);
    padding: 1rem;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ap-header h3 {
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: -0.3px;
    color: white;
    margin: 0;
}

.ap-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.8;
}

.ap-close:hover {
    opacity: 1;
}

/* 필지 관리 통계 */
.pm-stats {
    display: flex;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
}

.stat-item {
    flex: 1;
    text-align: center;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* 필지 카드 - 그리드 형식 */
.pm-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 2px;
    transition: all 0.2s;
    overflow: hidden;
}

.pm-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.pm-card-color {
    height: 3px;
}

.pm-card-content {
    padding: 0.75rem;
}

.pm-card-content h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.pm-card-info {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.pm-card-actions {
    display: flex;
    gap: 0.25rem;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
}

.pm-card-actions button {
    flex: 1;
    padding: 0.3rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 2px;
    font-size: 0.7rem;
    cursor: pointer;
}

.pm-card-actions button:hover {
    background: var(--bg-tertiary);
}

/* 헤더 캘린더 버튼 */
.header-calendar-btn {
    padding: 0.5rem 1.2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
}

.header-calendar-btn svg {
    width: 20px;
    height: 20px;
    color: white;
}

.header-calendar-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    border-color: rgba(255, 255, 255, 0.5);
}

.header-calendar-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

/* 캘린더 버튼 애니메이션 효과 */
.header-calendar-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.header-calendar-btn:hover::before {
    width: 300px;
    height: 300px;
    opacity: 0;
}

/* 로그아웃 버튼 */
.logout-btn {
    padding: 0.4rem 1rem;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
    margin-left: 0.5rem;
}

.logout-btn:hover {
    background: #a93226;
}

/* 캘린더 모달 스타일 */
.calendar-modal {
    width: 90%;
    max-width: 900px;
    height: 80vh;
    max-height: 700px;
}

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

.modal-header h2 {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
}

.modal-header .close {
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
}

.modal-header .close:hover {
    opacity: 1;
}

.modal-body {
    padding: 0;
    height: calc(100% - 120px);
}

.modal-footer {
    background: var(--bg-secondary);
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.modal-footer input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 2px;
    font-size: 0.85rem;
}

.btn-primary {
    padding: 0.5rem 1rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
}

.btn-primary:hover {
    background: #3a7bc8;
}

.btn-secondary {
    padding: 0.5rem 1rem;
    background: white;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 2px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
}

.btn-secondary:hover {
    background: var(--bg-secondary);
}

/* 모달 기본 스타일 */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

/* 모달 - 깔끔한 디자인 */
.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 2px;
    box-shadow: var(--shadow-lg);
    position: relative;
}

/* 애니메이션 제거 */
* {
    animation: none !important;
    transition-duration: 0.2s !important;
}

/* 스크롤바 스타일 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 1px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
