/* 고급 필지 관리 패널 스타일 */
.advanced-panel {
    position: fixed;
    top: 60px;
    right: -400px;
    width: 400px;
    height: calc(100vh - 60px);
    background: white;
    box-shadow: -4px 0 20px rgba(0,0,0,0.1);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    display: flex;
}

.advanced-panel.open {
    right: 0;
}

/* 토글 버튼 - 플로팅 원형 스타일 */
.ap-toggle {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #03c75a;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ap-toggle:hover {
    background: #03c75a;
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 4px 12px rgba(3, 199, 90, 0.3);
}

.ap-toggle-icon {
    color: #03c75a;
    font-size: 28px;
    font-weight: bold;
    transition: color 0.3s;
    line-height: 1;
}

.ap-toggle:hover .ap-toggle-icon {
    color: #ffffff;
}

/* 패널이 열렸을 때 버튼 위치 조정 */
.advanced-panel.open .ap-toggle {
    right: 420px;
}

/* 패널 콘텐츠 */
.ap-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.ap-header {
    padding: 20px;
    background: #03c75a; /* 네이버 그린 */
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ap-header h3 {
    margin: 0;
    font-size: 18px;
}

.ap-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s;
}

.ap-close:hover {
    background: rgba(255,255,255,0.2);
}

.ap-body {
    flex: 1;
    overflow-y: auto;
    background: #f8f9fa;
}

/* 통계 헤더 */
.pm-header {
    background: white;
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
}

.pm-stats {
    display: flex;
    justify-content: space-around;
}

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

.stat-label {
    display: block;
    font-size: 11px;
    color: #6c757d;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 20px;
    font-weight: bold;
    color: #2c3e50;
}

/* 검색 바 */
.pm-search {
    padding: 15px;
    background: white;
    border-bottom: 1px solid #e9ecef;
}

.pm-search input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e9ecef;
    border-radius: 20px;
    font-size: 14px;
    transition: all 0.3s;
}

.pm-search input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 컨트롤 바 */
.pm-controls {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: white;
    border-bottom: 1px solid #e9ecef;
    align-items: center;
}

.pm-filters {
    display: flex;
    gap: 5px;
    flex: 1;
}

.filter-btn {
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 12px;
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.filter-btn.active {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.filter-btn[data-filter^="#"] {
    width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 50%;
}

.pm-sort select {
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    background: white;
    font-size: 12px;
    cursor: pointer;
}

.pm-view-toggle {
    display: flex;
    gap: 2px;
    background: #e9ecef;
    border-radius: 8px;
    padding: 2px;
}

.view-btn {
    padding: 4px 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s;
    font-size: 16px;
}

.view-btn.active {
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* 일괄 작업 도구 */
.pm-bulk-actions {
    padding: 10px 15px;
    background: #fff3cd;
    border-bottom: 1px solid #ffc107;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pm-bulk-actions button {
    padding: 6px 12px;
    font-size: 12px;
    border: 1px solid #ffc107;
    background: white;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.pm-bulk-actions button:hover {
    background: #ffc107;
    color: white;
}

.pm-bulk-actions button.danger {
    border-color: #dc3545;
    color: #dc3545;
}

.pm-bulk-actions button.danger:hover {
    background: #dc3545;
    color: white;
}

/* 필지 목록 - 그리드 뷰 */
.pm-list {
    padding: 15px;
    min-height: 200px;
}

.pm-list.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 15px;
}

.pm-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
}

.pm-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.pm-card.selected {
    border: 2px solid #667eea;
}

.pm-card-select {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1;
}

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

.pm-card-content {
    padding: 12px;
}

.pm-card-content h4 {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pm-card-info {
    font-size: 11px;
    color: #6c757d;
    margin: 5px 0;
}

.pm-card-area {
    font-size: 11px;
    color: #28a745;
    font-weight: 600;
}

.pm-card-date {
    font-size: 10px;
    color: #adb5bd;
    margin-top: 8px;
}

.pm-card-actions {
    display: flex;
    gap: 5px;
    padding: 8px;
    background: #f8f9fa;
    justify-content: center;
}

.pm-card-actions button {
    padding: 6px 12px;
    border: none;
    background: #f8f9fa;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.3s;
}

.pm-card-actions button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.pm-card-actions .btn-map {
    background: #4285f4;
    color: white;
}

.pm-card-actions .btn-edit {
    background: #34a853;
    color: white;
}

.pm-card-actions .btn-delete {
    background: #ea4335;
    color: white;
}

/* 필지 목록 - 리스트 뷰 */
.pm-list.list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pm-list-item {
    background: white;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.pm-list-item:hover {
    box-shadow: 0 3px 8px rgba(0,0,0,0.12);
    transform: translateX(5px);
}

.pm-list-item.selected {
    background: #f0f4ff;
    border-left: 3px solid #667eea;
}

.pm-list-color {
    width: 4px;
    height: 40px;
    border-radius: 2px;
}

.pm-list-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.pm-list-address {
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pm-list-pnu,
.pm-list-owner,
.pm-list-area,
.pm-list-date {
    font-size: 11px;
    color: #6c757d;
}

.pm-list-actions {
    display: flex;
    gap: 5px;
}

.pm-list-actions button {
    padding: 5px 10px;
    border: none;
    background: #f8f9fa;
    cursor: pointer;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.3s;
}

.pm-list-actions button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.pm-list-actions .btn-map {
    background: #4285f4;
    color: white;
}

.pm-list-actions .btn-edit {
    background: #34a853;
    color: white;
}

.pm-list-actions .btn-delete {
    background: #ea4335;
    color: white;
}

/* 빈 상태 */
.pm-empty {
    text-align: center;
    padding: 60px 20px;
    color: #adb5bd;
}

.pm-empty .empty-icon {
    font-size: 48px;
    color: #dee2e6;
    margin-bottom: 15px;
}

.pm-empty .empty-title {
    font-size: 16px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

.pm-empty .empty-subtitle {
    font-size: 13px;
    color: #6c757d;
}

/* 하단 액션 */
.pm-footer {
    padding: 15px;
    background: white;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
}


/* 구글 시트 전송 버튼 */
.btn-export-google,
.pm-actions .btn-export-google {
    flex: 1;
    padding: 12px;
    background: linear-gradient(135deg, #34a853 0%, #0d8043 100%) !important;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-export-google:hover,
.pm-actions .btn-export-google:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 168, 83, 0.3);
}

/* 엑셀 복사 버튼 */
.btn-export,
.pm-actions .btn-export {
    flex: 1;
    padding: 12px;
    background: linear-gradient(135deg, #2b579a 0%, #1e3a6f 100%) !important;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-export:hover,
.pm-actions .btn-export:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(43, 87, 154, 0.3);
}

.danger-btn,
.pm-actions .btn-danger {
    flex: 1;
    padding: 12px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.danger-btn:hover,
.pm-actions .btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}

/* 개선된 캘린더 UI */
.floating-calendar-panel {
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    border-radius: 16px;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.calendar-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 12px 16px;
}

.calendar-title {
    font-weight: 600;
    font-size: 14px;
}

.calendar-controls button {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.calendar-controls button:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.1);
}

.calendar-footer {
    background: #f8f9fa;
    padding: 12px;
    display: flex;
    gap: 10px;
}

.calendar-input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 12px;
    transition: all 0.3s;
}

.calendar-input:focus {
    outline: none;
    border-color: #667eea;
}

.calendar-update-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.calendar-update-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

/* 플로팅 캘린더 버튼 개선 */
.floating-calendar-btn {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    width: 56px;
    height: 56px;
    font-size: 28px;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
    transition: all 0.3s;
}

.floating-calendar-btn:hover {
    transform: rotate(15deg) scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.6);
}

/* 애니메이션 */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

.pm-card {
    animation: fadeIn 0.3s ease-out;
}

.pm-list-item {
    animation: slideIn 0.3s ease-out;
}

/* 반응형 */
@media (max-width: 768px) {
    .advanced-panel {
        width: 100%;
        right: -100%;
    }
    
    .ap-toggle {
        left: -35px;
        width: 35px;
        height: 100px;
    }
    
    .pm-list.grid {
        grid-template-columns: 1fr;
    }
}
