@import url('https://cdn.jsdelivr.net/gh/sunn-us/SUIT/fonts/static/woff2/SUIT.css');

:root {
    --primary: #2e7d32;   /* 메인 진녹색 */
    --secondary: #e8f5e9; /* 배경 연녹색 */
    --dark: #111;         /* 글자 진한 검정 */
    --border: #bbb;       /* 테두리 (진하게 수정) */
    --accent: #e65100;    /* 포인트 주황 */
    --danger: #c62828;    /* 경고 빨강 */
}

body {
    font-family: 'SUIT', sans-serif;
    margin: 0; padding: 0;
    background-color: #f8f9fa;
    color: var(--dark);
    padding-top: 70px;
    padding-bottom: 80px;
    font-weight: 500;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

/* === 헤더 === */
header {
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--border);
    position: fixed; top: 0; left: 0; width: 100%; 
    height: 70px; z-index: 2000; 
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.header-inner { width: 100%; max-width: 1100px; padding: 0 15px; display: flex; justify-content: space-between; align-items: center; }
.logo img { height: 50px; object-fit: contain; }

/* === PC 메뉴 === */
.pc-nav { display: flex; gap: 20px; }
.pc-nav a { text-decoration: none; color: #222; font-weight: 800; padding: 10px; transition: 0.2s; }
.pc-nav a:hover, .pc-nav a.active { color: var(--primary); border-bottom: 3px solid var(--primary); }

/* === 모바일 하단 메뉴 (이미지 아이콘) === */
.bottom-nav {
    display: none; position: fixed; bottom: 0; left: 0; width: 100%; height: 65px;
    background: #fff; border-top: 1px solid #999; z-index: 3000;
    justify-content: space-around; align-items: center;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}
.nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; text-decoration: none; color: #333; font-weight: 700; flex: 1; height: 100%; font-size: 0.75rem; }
.nav-icon img { width: 28px; height: 28px; object-fit: contain; display: block; margin-bottom: 3px; }
.nav-item.active { color: var(--primary); font-weight: 900; }

@media (max-width: 768px) {
    .pc-nav { display: none !important; }
    .bottom-nav { display: flex !important; }
    .logo { margin: 0 auto; }
    .header-inner { justify-content: center; }
}

/* === 공통 === */
main { max-width: 1100px; margin: 0 auto; padding: 20px 15px; }

/* 버튼 스타일 */
.btn { padding: 0 15px; border: none; border-radius: 8px; cursor: pointer; font-weight: 800; font-size: 0.95rem; height: 44px; display: inline-flex; justify-content: center; align-items: center; text-decoration: none; transition: 0.2s; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-secondary { background: #eee; color: #111; border: 1px solid #ccc; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-mini { padding: 6px 12px; font-size: 0.85rem; border: 1px solid #999; background: #fff; border-radius: 6px; color: #111; font-weight: bold; cursor: pointer; }

/* === 지도 페이지 === */
#map { 
    width: 100%; height: 55vh; min-height: 400px; 
    border-radius: 12px; border: 1px solid #999; margin-bottom: 15px; 
    z-index: 1; position: relative; overflow: hidden; background: #eee; 
}
@media (max-width: 600px) { #map { height: 45vh; min-height: 300px; } }

/* 검색 컨트롤 (모바일 최적화) */
.map-controls { display: flex; gap: 5px; margin-bottom: 10px; width: 100%; box-sizing: border-box; }
.map-controls select { 
    width: 100px; padding: 0 5px; border: 1px solid #888; border-radius: 8px; 
    height: 44px; font-weight: bold; color: #000; background: #fff; font-size: 0.85rem;
}
.map-controls input { 
    flex: 1; padding: 0 10px; border: 1px solid #888; border-radius: 8px; 
    font-size: 0.95rem; height: 44px; box-sizing: border-box; 
}
.map-controls .btn { white-space: nowrap; padding: 0 12px; height: 44px; font-size: 0.9rem; }

/* 지도 상단 디자인 */
.map-intro {
    text-align: center; margin-bottom: 20px; padding: 20px 15px;
    background: linear-gradient(180deg, #ffffff 0%, #e8f5e9 100%);
    border-bottom: 1px solid #c8e6c9; border-radius: 0 0 20px 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}
.map-intro h2 { font-size: 1.6rem; color: #1b5e20; font-weight: 900; margin: 0 0 8px 0; letter-spacing: -1px; text-shadow: 2px 2px 0px #fff; }
.map-intro p { font-size: 0.95rem; color: #2e7d32; font-weight: 700; margin: 0; background-color: rgba(255, 255, 255, 0.8); display: inline-block; padding: 5px 15px; border-radius: 20px; }

.guide-box { background-color: #fff3e0; border: 1px solid #ffe0b2; color: #e65100; padding: 15px; border-radius: 8px; margin-bottom: 15px; font-size: 0.95rem; line-height: 1.5; font-weight: 600; text-align: center; word-break: keep-all; }
.info-box { background-color: #f1f8e9; border: 1px solid #c8e6c9; color: #33691e; padding: 15px; border-radius: 8px; margin-top: 30px; font-size: 0.9rem; line-height: 1.6; }

/* === 리스트 박스 (진하게 수정됨) === */
.job-item {
    background: #fff; border: 1px solid #999; /* 테두리 진하게 */
    border-radius: 10px; padding: 15px;
    margin-bottom: 12px; border-left: 6px solid #888; cursor: pointer;
    display: flex; justify-content: space-between; align-items: flex-start;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.job-item.selected {
    border-color: var(--primary); border-left-color: var(--primary);
    background-color: #e8f5e9; transform: scale(1.01);
    box-shadow: 0 4px 8px rgba(0,100,0,0.2);
}
.job-actions { display: flex; flex-direction: column; gap: 8px; margin-left: 10px; min-width: 90px; }
.action-row { display: flex; gap: 5px; }

.badge { display: inline-block; padding: 3px 6px; border-radius: 4px; font-size: 0.75rem; font-weight: 800; margin-bottom: 5px; }
.bg-red { background: #ffebee; color: #c62828; border: 1px solid #ffcdd2; }
.bg-blue { background: #e3f2fd; color: #1565c0; border: 1px solid #bbdefb; }

/* === 지도 라벨 (말풍선) === */
.map-label {
    background: #fff; border: 1px solid #333; padding: 3px 8px; border-radius: 4px;
    font-size: 12px; font-weight: 900; color: #000; box-shadow: 1px 1px 3px rgba(0,0,0,0.3);
    white-space: nowrap; transform: translateY(-45px); /* 핀 위로 올림 */
}
.label-hire { border-color: #d32f2f; color: #d32f2f; }
.label-seek { border-color: #1565c0; color: #1565c0; }

/* === 팝업 (정중앙 정렬) === */
.modal, .tip-modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 4000; justify-content: center; align-items: center; }
.modal-content { 
    background: #fff; width: 85%; max-width: 320px; 
    border-radius: 16px; padding: 20px; 
    max-height: 80vh; overflow-y: auto; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.3); margin: auto;
}
.modal-title { font-size: 1.1rem; font-weight: 900; color: #111; margin: 0 0 15px; text-align: center; border-bottom: 2px solid #f0f0f0; padding-bottom: 10px; }
.modal-warning { background: #fff8e1; border: 1px solid #ffe0b2; color: #333; padding: 12px; border-radius: 8px; font-size: 0.85rem; margin-bottom: 15px; line-height: 1.5; word-break: keep-all; }
.modal input, .modal textarea, .modal select { width: 100%; padding: 10px; border: 1px solid #999; border-radius: 8px; font-size: 0.95rem; margin-bottom: 8px; box-sizing: border-box; }

/* === 꿀팁 탭 === */
.tip-tabs { display: flex; gap: 5px; margin-bottom: 15px; border-bottom: 2px solid #eee; }
.tip-tab-btn { flex: 1; padding: 10px; border: none; background: #f5f5f5; font-weight: 900; cursor: pointer; color: #555; border-radius: 8px 8px 0 0; font-size: 0.9rem; }
.tip-tab-btn.active { background: #2e7d32; color: #fff; }
.tip-panel { display: none; font-size: 0.9rem; line-height: 1.5; color: #333; font-weight: 500; }
.tip-panel.active { display: block; }
.tip-box { background: #f9f9f9; padding: 10px; border-radius: 8px; margin-top: 8px; font-size: 0.9rem; border: 1px solid #eee; color: #444; }

/* 필터 버튼 */
.filter-btn-group { display: flex; gap: 5px; margin-bottom: 15px; }
.filter-btn { flex: 1; padding: 10px; border: 1px solid #ccc; background: #fff; border-radius: 6px; font-weight: 700; color: #555; }
.filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 광고 */
.ad-placeholder { text-align: center; padding: 15px; margin: 15px 0; border-radius: 12px; font-weight: bold; font-size: 0.85rem; }
.ad-fit { background: #fffde7; border: 2px dashed #fbc02d; color: #f57f17; }
.ad-dable { background: #ffebee; border: 2px dashed #ef5350; color: #c62828; }

/* 푸터 */
footer { text-align: center; padding: 40px 20px; background: #f9f9f9; border-top: 1px solid #ddd; margin-top: 40px; margin-bottom: 80px; color: #222; font-weight: 700; font-size: 0.8rem; line-height: 1.6; }
footer a { color: #000; text-decoration: none; margin: 0 5px; font-weight: 900; }
/* ★ [추가] 현장 보드판 스타일 (오른쪽 하단) ★ */
      .board-item {
          position: absolute; bottom: 0; right: 0;
          width: 45%; background: #fff; border: 2px solid #000;
          z-index: 50; touch-action: none;
          font-size: 0.6rem; color: #000;
          box-shadow: -2px -2px 5px rgba(0,0,0,0.3);
      }
      .board-table { width: 100%; border-collapse: collapse; text-align: center; font-weight: bold; table-layout: fixed; }
      .board-table td { border: 1px solid #000; padding: 3px 1px; vertical-align: middle; height: 18px; }
      .board-th { background: #bbdefb; width: 30%; font-weight: 900; } /* 파란 헤더 */
      .board-content { background: #fff; width: 70%; word-break: break-all; font-size: 0.55rem; }
      
      .board-del-btn {
          position: absolute; top: -10px; left: -10px;
          background: #c62828; color: #fff; border: 1px solid #fff;
          width: 24px; height: 24px; border-radius: 50%;
          font-size: 14px; font-weight: bold;
          display: flex; justify-content: center; align-items: center;
          cursor: pointer; z-index: 60;
      }

      /* ★ [추가] 보드판 입력창 (모달) ★ */
      .board-modal { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.5); z-index:2000; justify-content:center; align-items:center; }
      .board-form { background:#fff; width:90%; max-width:320px; padding:20px; border-radius:15px; box-shadow:0 10px 25px rgba(0,0,0,0.3); }
      .board-form h3 { margin:0 0 15px; text-align:center; color:#1565c0; }
      .form-row { margin-bottom:10px; }
      .form-label { font-weight:bold; font-size:0.9rem; display:block; margin-bottom:5px; }
      .form-input { width:100%; padding:8px; border:1px solid #ccc; border-radius:6px; box-sizing:border-box; }
      
      .tag-container { display:flex; flex-wrap:wrap; gap:5px; margin-bottom:10px; }
      .tag-btn { padding:5px 10px; border:1px solid #ccc; background:#f5f5f5; border-radius:15px; font-size:0.8rem; cursor:pointer; font-weight:bold; }
      .tag-btn.selected { background:#1565c0; color:#fff; border-color:#1565c0; }

      .form-actions { display:flex; gap:10px; margin-top:20px; }
      .btn-board { background: #1565c0; color: #fff; }
      /* --- 워터마크 스타일 --- */
.nodaji-watermark {
    position: absolute;
    bottom: 10px;
    /* 여기를 right에서 left로 변경하세요 */
    left: 10px;
    
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7); /* 흰색 반투명 */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    z-index: 9999;
    font-weight: bold;
    font-family: sans-serif;
}
/* =========================================
   ★ 새로운 노다지 버튼 스타일 (세련된 버전) ★
   ========================================= */

/* 버튼을 감싸는 컨테이너 (나란히 배치) */
.nodaji-btn-group {
    display: flex;
    gap: 10px; /* 버튼 사이 간격 */
    margin: 15px auto; /* 위아래 여백 */
    width: 95%; /* 전체 너비 */
    max-width: 400px; /* 너무 넓어지지 않게 제한 */
}

/* 기본 버튼 스타일 */
.nodaji-btn {
    flex: 1; /* 두 버튼의 너비를 똑같게 */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 15px;
    border: none;
    border-radius: 12px; /* 둥근 모서리 */
    font-family: 'Pretendard', sans-serif; /* 세련된 폰트 (없으면 기본 폰트 적용됨) */
    font-size: 15px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15); /* 부드러운 그림자 */
    transition: all 0.2s ease; /* 클릭 시 부드러운 효과 */
}

/* 아이콘과 텍스트 사이 간격 */
.btn-icon {
    margin-right: 8px;
    font-size: 18px;
}

/* 클릭 효과 (눌리는 느낌) */
.nodaji-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.15);
}

/* --- 버튼별 색상 --- */

/* 1. 저장 버튼 (세련된 파랑) */
.save-btn {
    background: linear-gradient(135deg, #2196F3, #1976D2); /* 그라데이션 효과 */
}

/* 2. 공유 버튼 (세련된 초록 / 카카오톡 색상 느낌) */
.share-btn {
    background: linear-gradient(135deg, #4CAF50, #388E3C); /* 그라데이션 효과 */
    /* 카카오톡 느낌을 더 원하시면 아래 색상 코드를 쓰세요 */
    /* background: #FEE500; color: #3C1E1E; */ 
}
/* =============================================
   ★ 노다지 포토 - 사진 그리드 레이아웃 ★
   ============================================= */

/* Photo Grid Wrapper */
.photo-grid-wrapper {
    position: relative;
    background-color: #222;
    border-radius: 12px;
    margin-bottom: 20px;
    min-height: 280px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.25);
    padding: 4px;
}

/* Photo Grid 기본 */
#photoGrid,
.photo-grid {
    display: grid !important;
    gap: 4px !important;
    width: 100% !important;
    touch-action: pan-y pinch-zoom;
    background-color: #222;
    padding: 4px;
    border-radius: 12px;
    min-height: 280px;
    position: relative;
}

/* 1장일 때 */
#photoGrid.grid-1,
.photo-grid.grid-1 { 
    grid-template-columns: 1fr !important;
    grid-template-rows: minmax(260px, 1fr) !important;
}

/* 2장일 때 - 가로 2장 */
#photoGrid.grid-2,
.photo-grid.grid-2 { 
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: minmax(180px, 1fr) !important;
}

/* 3장일 때 - 위 2장, 아래 1장 */
#photoGrid.grid-3,
.photo-grid.grid-3 { 
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: 1fr 1fr !important;
}

#photoGrid.grid-3 > .photo-frame:nth-child(3),
.photo-grid.grid-3 > .photo-frame:nth-child(3) {
    grid-column: 1 / -1 !important;
}

/* 4장일 때 - 2x2 그리드 */
#photoGrid.grid-4,
.photo-grid.grid-4 { 
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: 1fr 1fr !important;
}

/* Photo Frame */
.photo-frame {
    position: relative;
    background: #1a1a1a;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 3px solid transparent;
    min-height: 80px;
    width: 100%;
    cursor: pointer;
    transition: border-color 0.2s;
    border-radius: 6px;
}

.photo-frame.selected { 
    border: 4px solid #00E676;
    z-index: 5;
}

.photo-img { 
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    background-color: #000;
}

/* 사진 삭제 버튼 */
.photo-del-btn {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 28px;
    height: 28px;
    background: rgba(211, 47, 47, 0.95);
    color: white;
    border-radius: 50%;
    border: 2px solid white;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 50;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* Empty Message */
.empty-msg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    text-align: center;
    font-size: 1.1rem;
    padding: 20px;
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    width: 80%;
    z-index: 10;
    pointer-events: none;
}

/* Watermark */
.watermark {
    position: absolute;
    bottom: 8px;
    left: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    font-weight: 700;
    pointer-events: none;
    z-index: 100;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

/* =============================================
   ★ 보드판 스타일 - 오른쪽 하단, 작은 크기 ★
   ============================================= */
.style-board {
    background: #fff;
    border: 1.5px solid #000;
    border-radius: 3px;
    color: #000;
    font-weight: 800;
    font-size: 7px;
    box-shadow: 1px 1px 4px rgba(0,0,0,0.4);
    padding: 0;
    overflow: hidden;
    position: absolute;
    bottom: 4px;
    right: 4px;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    z-index: 100;
    cursor: pointer;
    min-width: 55px;
    max-width: 90px;
}

.style-board.active { 
    border-color: #ff0000;
    box-shadow: 0 0 8px rgba(255,0,0,0.5);
}

/* 그리드별 보드판 크기 */
.grid-1 .style-board {
    font-size: 8px !important;
    min-width: 65px;
    max-width: 100px;
}

.grid-2 .style-board,
.grid-3 .style-board { 
    font-size: 6px !important;
    min-width: 50px;
    max-width: 75px;
}

.grid-4 .style-board { 
    font-size: 5px !important;
    min-width: 45px;
    max-width: 65px;
}

/* 보드판 테이블 */
.style-board .board-table { 
    border-collapse: collapse;
    width: 100%;
    text-align: center;
    table-layout: fixed;
}

.style-board .board-table td { 
    border: 1px solid #444;
    padding: 2px 3px;
    word-break: break-word;
    overflow: hidden;
    line-height: 1.2;
}

.style-board .board-th { 
    font-weight: 900;
    white-space: nowrap;
    background-color: #f0f0f0;
}

/* 그리드별 테이블 셀 크기 */
.grid-1 .style-board .board-table td {
    padding: 3px 4px !important;
}

.grid-2 .style-board .board-table td,
.grid-3 .style-board .board-table td { 
    padding: 1px 2px !important;
}

.grid-4 .style-board .board-table td { 
    padding: 1px 2px !important;
}

/* 삭제 버튼 */
.item-del-btn {
    display: none;
    position: absolute;
    top: -10px;
    left: -10px;
    width: 24px;
    height: 24px;
    background: #ff0000;
    color: white;
    border-radius: 50%;
    border: 2px solid white;
    text-align: center;
    line-height: 20px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    z-index: 300;
}

.style-board.active .item-del-btn,
.draggable-item.active .item-del-btn { 
    display: block;
}

/* 텍스트 아이템 */
.draggable-item {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    cursor: move;
    touch-action: none;
    text-align: center;
    padding: 8px;
    border: 2px dashed transparent;
}

.draggable-item.active { 
    border-color: #ffeb3b;
    background-color: rgba(0,0,0,0.15);
}

.style-text {
    color: #fff;
    font-weight: 900;
    font-size: 1.4rem;
    text-shadow: 
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000;
}

/* 리사이즈 핸들 */
.resize-handle {
    display: none;
    position: absolute;
    bottom: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: #1565c0;
    color: white;
    border-radius: 50%;
    border: 2px solid white;
    cursor: nwse-resize;
    z-index: 250;
}

.draggable-item.active .resize-handle { 
    display: block;
}

/* Saving Mode - 저장시 버튼 숨김 */
.saving-mode .photo-del-btn,
.saving-mode .item-del-btn,
.saving-mode .resize-handle {
    display: none !important;
}

.saving-mode .photo-frame.selected { 
    border-color: transparent !important;
}

.saving-mode .draggable-item.active { 
    border-color: transparent !important;
    background-color: transparent !important;
}
