/* 모험단 관리 화면 스타일 */

/* 전체 컨테이너 */
.adventure-container {
    padding: 20px 10px;
    max-width: 100%;
    box-sizing: border-box;
}

/* 헤더 영역 */
.adventure-header {
    margin-bottom: 10px;
}

.adventure-header h1 {
    font-size: 2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.adventure-header p {
    color: #666;
    font-size: 1rem;
}

/* 버튼 스타일 */
.button-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

/* 편집 종료/캐릭터관리 버튼은 내용 크기만 유지 */
.button-group > #edit-order-btn {
    flex: 0 0 auto;
}

/* 편집 버튼들(초기화, 저장) */
.button-group > .edit-buttons {
    flex: 0 0 auto;
}

/* 리스트형/박스형 토글: 항상 보이고 오른쪽 정렬 */
.button-group > .view-mode-row {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-end;
}

.btn {
    padding: 8px 16px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background-color: #ffffff;
    color: #495057;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn:hover {
    background-color: #f8f9fa;
}

.btn-primary {
    background-color: #4a90e2;
    border-color: #4a90e2;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #357abd;
    border-color: #357abd;
}

.btn-edit {
    background-color: #4a90e2;
    border-color: #4a90e2;
    color: #ffffff;
}

.btn-edit:hover {
    background-color: #357abd;
    border-color: #357abd;
    color: #ffffff;
}

.edit-buttons {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.edit-buttons-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.view-mode-row {
    display: flex;
    align-items: center;
}

/* 리스트형 / 박스형 뷰 전환 */
.view-mode-toggle {
    display: inline-flex;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
}

.btn-view-mode {
    padding: 6px 12px;
    border: none;
    border-radius: 0;
    background: #fff;
    color: #6c757d;
    font-size: 13px;
    cursor: pointer;
}

.btn-view-mode:not(:last-child) {
    border-right: 1px solid #dee2e6;
}

.btn-view-mode:hover {
    background: #f8f9fa;
    color: #495057;
}

.btn-view-mode.active {
    background: #4a90e2;
    color: #fff;
}

.btn-view-mode.active:hover {
    background: #357abd;
    color: #fff;
}

.btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #ffffff;
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

/* 그리드 컨테이너 */
.grid-container {
    background-color: #ffffff !important;
    border: 1px solid #e9ecef !important;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

/* 박스형: 카드 그리드 영역 */
.adventure-order-cards-wrap {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.adventure-cards-hint {
    color: #6c757d;
    font-size: 13px;
    margin: 0 0 12px 0;
}

/* PC: 8개 한 줄, 간격 12px */
.adventure-order-cards {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 12px;
    min-height: 200px;
}

.adventure-order-card {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    box-sizing: border-box;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    cursor: grab;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.adventure-order-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.adventure-order-card:active {
    cursor: grabbing;
}

/* 박스형 편집: 왼쪽 상단 활성/삭제 토글 (리스트 화면과 동일 색, 동그란 버튼) */
.adventure-order-card-toggle {
    position: absolute;
    top: 2px;
    left: 2px;
    z-index: 1;
}
.adventure-card-status-btn {
    width: 24px;
    height: 24px;
    padding: 0;
    font-size: 10px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-weight: 600;
    color: #fff;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.adventure-card-status-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}
.adventure-card-status-btn.is-active {
    background: linear-gradient(135deg, #4a90e2, #357abd);
}
.adventure-card-status-btn.is-active:hover {
    background: linear-gradient(135deg, #357abd, #2c5aa0);
}
.adventure-card-status-btn.is-inactive {
    background: linear-gradient(135deg, #6c757d, #5a6268);
}
.adventure-card-status-btn.is-inactive:hover {
    background: linear-gradient(135deg, #5a6268, #495057);
}

/* 모바일: 드래그는 핸들만 반응, 나머지 터치로 스크롤 */
.adventure-order-card-handle {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    cursor: grab;
    color: #6c757d;
    background: rgba(255,255,255,0.9);
    border-radius: 4px;
    touch-action: none;
}
.adventure-order-card-handle:active {
    cursor: grabbing;
}
.adventure-order-card-handle .fa-grip-vertical {
    font-size: 12px;
}

.adventure-order-card.is-hidden {
    opacity: 0.6;
}

.adventure-order-card-img {
    width: 100%;
    flex: 1;
    min-height: 44px;
    background-size: 170px auto;
    background-repeat: no-repeat;
    background-color: #e9ecef;
}

.adventure-order-card-name {
    flex-shrink: 0;
    padding: 2px 4px 0;
    font-size: 11px;
    font-weight: 600;
    color: #333;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.adventure-order-card-meta {
    flex-shrink: 0;
    padding: 0 4px 4px;
    font-size: 9px;
    color: #6c757d;
    text-align: center;
    line-height: 1.3;
}
.adventure-order-card-job,
.adventure-order-card-fame {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.adventure-order-card.adventure-card-chosen {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    transform: scale(1.02);
}

.adventure-order-card.adventure-card-dragging {
    opacity: 0.5;
}

/* Tabulator 기본 스타일 */
.tabulator {
    border: none !important;
    background-color: #ffffff !important;
}

.tabulator-header {
    background-color: #ffffff !important;
    border-bottom: 1px solid #f1f3f4 !important;
}

.tabulator-header .tabulator-col {
    background-color: #f8f9fa !important;
    border-right: 1px solid #e9ecef !important;
    font-weight: 600 !important;
    color: #495057 !important;
    padding: 0px 1px !important;
}

.tabulator-col {
    background-color: #ffffff !important;
    border-right: 1px solid #f1f3f4 !important;
    color: #2c3e50 !important;
    font-weight: 600;
    padding: 16px 12px;
    cursor: pointer;
    font-size: 14px;
    text-align: left;
    transition: background-color 0.2s ease;
}

.tabulator-header .tabulator-col {
    cursor: pointer !important;
}

.tabulator-col:hover {
    background-color: #f8f9fa !important;
}

.tabulator-col-title {
    padding-right: 10px !important;
}

.tabulator-cell {
    border-right: 1px solid #f8f9fa !important;
    border-bottom: 1px solid #f8f9fa !important;
    background-color: #ffffff !important;
    color: #2c3e50 !important;
    font-size: 14px;
    padding: 16px 12px;
    vertical-align: middle;
    line-height: 1.5;
    transition: background-color 0.2s ease;
    cursor: default;
}

.tabulator-row:hover .tabulator-cell {
    background-color: #f8f9fa !important;
}

/* 선택된 행 강조 표시 */
.tabulator-row.tabulator-selected {
    background-color: #7aacce !important;
    border-bottom: 2px solid #898c8d !important;
}

/* 선택된 행의 name-text에 밑줄 추가 */
.tabulator-row.tabulator-selected .name-text {
    font-weight: bold;
}

.tabulator-row.tabulator-selected:hover {
    background-color: #a4d6ff !important;
}

/* 순서 조정 버튼 스타일 */
.order-btn {
    background: none;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    padding: 3px 6px;
    margin: 0 1px;
    cursor: pointer;
    font-size: 10px;
    color: #6c757d;
    transition: all 0.2s ease;
    min-width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.order-btn:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    color: #495057;
}

.order-btn.up-btn {
    color: #28a745;
}

.order-btn.down-btn {
    color: #2196f3;
}

.order-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 삭제/활성 버튼 스타일 */
.status-toggle-btn {
    min-width: 50px !important;
    max-width: 50px !important;
    font-weight: 500 !important;
    border-radius: 4px !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
    border: none !important;
    padding: 4px 8px !important;
    font-size: 11px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
}

.status-toggle-btn:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15) !important;
}

.status-toggle-btn:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

/* 활성 상태 버튼 */
.btn-success.status-toggle-btn {
    background: linear-gradient(135deg, #4a90e2, #357abd) !important;
    color: white !important;
}

.btn-success.status-toggle-btn:hover {
    background: linear-gradient(135deg, #357abd, #2c5aa0) !important;
}

/* 삭제 상태 버튼 */
.btn-secondary.status-toggle-btn {
    background: linear-gradient(135deg, #6c757d, #5a6268) !important;
    color: white !important;
}

.btn-secondary.status-toggle-btn:hover {
    background: linear-gradient(135deg, #5a6268, #495057) !important;
}

/* 로딩 오버레이 스타일 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4a90e2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #6c757d;
    font-size: 16px;
    margin: 0;
    font-weight: 500;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .adventure-container {
        padding: 0px 0px;
    }

    /* 모바일: 최소 3개 한 줄, 간격 축소 */
    .adventure-order-cards-wrap {
        padding: 10px;
    }
    .adventure-order-cards {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    .adventure-order-card-img {
        min-height: 40px;
    }
    .adventure-order-card-name {
        font-size: 10px;
    }
    .adventure-order-card-meta {
        font-size: 8px;
    }

    .button-group {
        flex-direction: row;
        gap: 8px;
        justify-content: flex-end;
    }
    
    .btn {
        width: auto;
        min-width: 50px;
        text-align: center;
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .adventure-header h1 {
        font-size: 1.5rem;
    }
    
    .adventure-header p {
        font-size: 0.9rem;
    }
    
    .tabulator-col,
    .tabulator-cell {
        padding: 12px 8px;
        font-size: 13px;
    }
    
    .loading-spinner {
        padding: 20px;
        margin: 20px;
    }
    
    .spinner {
        width: 30px;
        height: 30px;
        border-width: 3px;
    }
    
    .loading-text {
        font-size: 14px;
    }
} 