/* ================================================
   보스 구인구직 페이지 스타일
   색상 기준: #3C3744, #B4C5E4, #FBFFF1
   ================================================ */

.recruit-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 30px 20px 60px;
    min-height: calc(100vh - 200px);
    box-sizing: border-box;
}

/* ================================================
   탭 영역
   ================================================ */
.recruit-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 2px solid #e0e0e0;
    width: 100%;
    min-width: 300px;
}
.recruit-tab {
    padding: 12px 24px;
    background: none;
    border: none;
    font-size: 15px;
    font-weight: 500;
    color: #888;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}
.recruit-tab:hover { color: #3C3744; }
.recruit-tab.active {
    color: #3C3744;
    font-weight: 700;
    border-bottom-color: #3C3744;
}
.recruit-tab-content { display: none; min-height: calc(100vh - 400px); width: 100%; }
.recruit-tab-content.active { display: block; }

/* ================================================
   필터 영역
   ================================================ */
.recruit-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 24px;
}
.filter-difficulty-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.diff-tab {
    padding: 6px 14px;
    border: 1px solid #d0d0d0;
    background: white;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    color: #555;
}
.diff-tab:hover { border-color: #3C3744; color: #3C3744; }
.diff-tab.active {
    background: #3C3744;
    color: white;
    border-color: #3C3744;
}
.filter-selects {
    display: flex;
    gap: 8px;
}
.filter-selects select {
    padding: 7px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    font-size: 13px;
    background: white;
    color: #333;
}
.recruit-create-btn {
    margin-left: auto;
    padding: 8px 20px;
    background: #3C3744;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.recruit-create-btn:hover { background: #2d2b35; }

/* ================================================
   공고 카드 그리드
   ================================================ */
.recruit-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.recruit-card {
    background: white;
    border: 1px solid #e8e8e8;
    border-radius: 14px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}
.recruit-card:hover {
    border-color: #B4C5E4;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    transform: translateY(-2px);
}
.recruit-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}
.recruit-card-boss {
    font-size: 18px;
    font-weight: 700;
    color: #3C3744;
}
.recruit-card-members {
    text-align: right;
    font-size: 13px;
    color: #888;
}
.recruit-card-members strong {
    font-size: 18px;
    color: #3C3744;
    display: block;
}
.recruit-card-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-right: 4px;
}
.badge-difficulty {
    background: #f0f0f0;
    color: #555;
}
.badge-open { background: #e8f5e9; color: #2e7d32; }
.badge-closed { background: #fce4ec; color: #c62828; }
.badge-expired { background: #f5f5f5; color: #999; }
.badge-edited { background: #fff3e0; color: #e65100; font-size: 10px; }
.badge-pending { background: #e3f2fd; color: #1565c0; font-size: 10px; animation: pulse-badge 2s infinite; }
@keyframes pulse-badge { 0%,100% { opacity: 1; } 50% { opacity: 0.6; } }

.recruit-card-info {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.recruit-card-desc {
    font-size: 13px;
    color: #555;
    background: #f9f9f9;
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    max-height: 40px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.recruit-card-leader {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}
.recruit-card-leader-img-wrap {
    flex-shrink: 0;
    width: 70px;
    height: 90px;
    overflow: hidden;
    position: relative;
}
.recruit-card-leader img {
    position: absolute;
    width: 300px;
    height: auto;
    left: -105px;
    top: -130px;
}
.leader-info {
    font-size: 12px;
    color: #888;
    line-height: 1.5;
}
.leader-info .leader-name {
    font-size: 14px;
    font-weight: 600;
    color: #3C3744;
}

/* ================================================
   페이지네이션
   ================================================ */
.recruit-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 30px;
}
.recruit-pagination button {
    padding: 8px 14px;
    border: 1px solid #d0d0d0;
    background: white;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
}
.recruit-pagination button.active {
    background: #3C3744;
    color: white;
    border-color: #3C3744;
}

/* ================================================
   공고 상세 모달
   ================================================ */
.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}
.detail-boss-name {
    font-size: 24px;
    font-weight: 700;
    color: #3C3744;
}
.detail-members {
    text-align: right;
    font-size: 13px;
    color: #888;
}
.detail-members strong {
    font-size: 22px;
    color: #3C3744;
    display: block;
}
.detail-info-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 14px;
    color: #555;
    margin-bottom: 20px;
}
.detail-info-row span { display: flex; align-items: center; gap: 4px; }
.detail-desc-box {
    background: #f7f8fa;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 24px;
}
.detail-desc-box h3 { font-size: 14px; font-weight: 600; margin-bottom: 8px; color: #3C3744; }
.detail-desc-box p { font-size: 14px; color: #555; line-height: 1.7; white-space: pre-wrap; }

/* 캐릭터 카드 */
.char-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f7f8fa;
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.2s;
}
.char-card:hover { background: #eef1f6; }
.char-card.no-click { cursor: default; }
.char-card.no-click:hover { background: #f7f8fa; }
.char-card-img-wrap {
    flex-shrink: 0;
    width: 56px;
    height: 72px;
    overflow: hidden;
    position: relative;
}
.char-card-img-wrap img {
    position: absolute;
    width: 240px;
    height: auto;
    left: -84px;
    top: -104px;
}
.char-card-info { flex: 1; }
.char-card-name { font-size: 15px; font-weight: 600; color: #3C3744; }
.char-card-spec { font-size: 12px; color: #888; line-height: 1.5; }
.char-card-combat { font-size: 13px; color: #c0392b; font-weight: 600; }

.detail-section { margin-bottom: 24px; }
.detail-section h3 {
    font-size: 16px;
    font-weight: 700;
    color: #3C3744;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 신청서 카드 */
.app-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: #f7f8fa;
    border-radius: 10px;
    margin-bottom: 8px;
}
.app-card-img-wrap {
    flex-shrink: 0;
    width: 56px;
    height: 72px;
    overflow: hidden;
    position: relative;
}
.app-card-img-wrap img {
    position: absolute;
    width: 240px;
    height: auto;
    left: -84px;
    top: -104px;
}
.app-card-info { flex: 1; }
.app-card-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.app-status {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 10px;
}
.app-status-pending { background: #fff3e0; color: #e65100; }
.app-status-accepted { background: #e8f5e9; color: #2e7d32; }
.app-status-rejected { background: #fce4ec; color: #c62828; }
.app-status-cancelled { background: #f5f5f5; color: #999; }

/* ================================================
   내 신청 목록
   ================================================ */
.my-apps-list,
.my-recruits-list {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    align-content: start;
}

.my-apps-list .recruit-empty,
.my-recruits-list .recruit-empty {
    grid-column: 1 / -1;
    width: 100%;
    box-sizing: border-box;
}

.my-app-item {
    background: white;
    border: 1px solid #e8e8e8;
    border-radius: 14px;
    padding: 20px;
    transition: all 0.2s;
}
.my-app-item:hover {
    border-color: #B4C5E4;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    transform: translateY(-2px);
}
.my-app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}
.my-app-boss { font-size: 16px; font-weight: 700; color: #3C3744; margin-bottom: 8px; }
.my-app-detail { font-size: 13px; color: #666; line-height: 1.7; }
.my-app-password {
    margin-top: 8px;
    padding: 10px;
    background: #f0f7ff;
    border-radius: 8px;
    font-size: 13px;
    color: #1565c0;
}
.my-app-password.expired {
    background: #fff3e0;
    color: #e65100;
}

/* ================================================
   모달 공통
   ================================================ */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-content {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}
.modal-large { max-width: 800px; }
.modal-close {
    position: absolute;
    top: 16px; right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #888;
    line-height: 1;
}
.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #3C3744;
    margin-bottom: 20px;
}
.modal-desc {
    font-size: 13px;
    color: #666;
    margin-bottom: 16px;
    line-height: 1.6;
}

/* ================================================
   폼 요소
   ================================================ */
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #3C3744;
    margin-bottom: 6px;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: #333;
}
.form-group textarea { resize: vertical; }
.form-row {
    display: flex;
    gap: 12px;
}
.form-row .form-group { flex: 1; }

.btn-primary {
    width: 100%;
    padding: 12px;
    background: #3C3744;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-primary:hover { background: #2d2b35; }
.btn-small {
    padding: 4px 10px;
    background: #B4C5E4;
    color: #3C3744;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 600;
}
.btn-accept {
    padding: 6px 14px;
    background: #2e7d32;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.btn-reject {
    padding: 6px 14px;
    background: #c62828;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.btn-cancel {
    padding: 6px 14px;
    background: #f5f5f5;
    color: #666;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
}
.btn-action {
    padding: 6px 14px;
    background: #f5f5f5;
    color: #3C3744;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}

/* 미연동 파티원 입력 */
.linked-member-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f0f4ff;
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 13px;
}
.linked-member-img-wrap {
    flex-shrink: 0;
    width: 40px;
    height: 52px;
    overflow: hidden;
    position: relative;
}
.linked-member-img-wrap img {
    position: absolute;
    width: 170px;
    height: auto;
    left: -60px;
    top: -74px;
}
.linked-member-name { font-weight: 600; color: #3C3744; }
.linked-member-spec { color: #666; }
.linked-member-cp { color: #c0392b; font-weight: 600; margin-left: auto; }

.manual-member-row {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.manual-member-row input {
    flex: 1;
    min-width: 80px;
    padding: 6px 8px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    font-size: 12px;
}
.manual-member-row button {
    padding: 6px 10px;
    background: #fce4ec;
    color: #c62828;
    border: none;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
}

/* ================================================
   장비 모달
   ================================================ */
.equip-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}
.equip-header-img-wrap {
    flex-shrink: 0;
    width: 70px;
    height: 90px;
    overflow: hidden;
    position: relative;
}
.equip-header-img-wrap img {
    position: absolute;
    width: 300px;
    height: auto;
    left: -105px;
    top: -130px;
}
.equip-header-info h3 { font-size: 18px; font-weight: 700; color: #3C3744; }
.equip-header-info p { font-size: 13px; color: #888; }
.equip-updated { font-size: 12px; color: #aaa; margin-top: 4px; }

/* 슬롯 배치 그리드 */
.equip-slot-grid {
    display: grid;
    grid-template-columns: repeat(7, 52px);
    grid-template-rows: repeat(6, 52px);
    gap: 4px;
    margin: 16px auto;
    width: fit-content;
}
.equip-slot-char-cell {
    grid-column: 3 / 6;
    grid-row: 1 / 5;
    background: #eef3ff;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}
.equip-slot-char-cell img {
    position: absolute;
    width: 430px;
    height: auto;
    left: 50%;
    transform: translateX(-50%);
    top: -90px;
}
.equip-slot-item {
    position: relative;
    width: 52px;
    height: 52px;
    background: #f7f8fa;
    border: 2px solid #ccc;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    transition: background 0.15s;
}
.equip-slot-item:hover { background: #e8edf5; }
.equip-slot-item img { width: 38px; height: 38px; object-fit: contain; }
.equip-slot-item .slot-star {
    position: absolute;
    top: 1px;
    left: 2px;
    font-size: 9px;
    color: #f5a623;
    font-weight: 700;
    line-height: 1;
    text-shadow: 0 0 3px rgba(0,0,0,0.5);
}
.equip-slot-item.pot-rare      { border-color: #55b4f5; }
.equip-slot-item.pot-epic      { border-color: #b381e6; }
.equip-slot-item.pot-unique    { border-color: #f5c842; }
.equip-slot-item.pot-legendary { border-color: #6eff6e; box-shadow: 0 0 6px rgba(110,255,110,0.4); }

.equip-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}
.equip-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #f7f8fa;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    transition: background 0.15s;
}
.equip-item:hover { background: #eef1f6; }
.equip-item img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}
.equip-item-info {
    flex: 1;
    min-width: 0;
}
.equip-item-name {
    font-size: 12px;
    font-weight: 500;
    color: #3C3744;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.equip-item-meta {
    font-size: 10px;
    color: #999;
    display: flex;
    gap: 6px;
}
.equip-star { color: #f5a623; font-weight: 700; }

/* 장비 툴팁 */
.equip-tooltip {
    position: fixed;
    background: #2d2b35;
    color: #f0f0f0;
    padding: 14px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.7;
    z-index: 3000;
    min-width: 260px;
    max-width: 340px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    pointer-events: none;
}
.tooltip-item-meta {
    display: flex;
    gap: 10px;
    font-size: 11px;
    color: #aaa;
    margin-bottom: 4px;
}
.tooltip-scroll {
    font-size: 11px;
    color: #aaa;
    margin-bottom: 4px;
}
.tooltip-scroll .scroll-used { color: #f5a623; font-weight: 600; }
.tooltip-stats {
    margin: 6px 0;
    padding: 6px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.tooltip-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    line-height: 1.6;
}
.tooltip-stat-name {
    color: #b0b0b0;
    white-space: nowrap;
    flex-shrink: 0;
}
.tooltip-stat-value {
    color: #e8e8e8;
    font-weight: 600;
    text-align: right;
}
.tooltip-stat-breakdown {
    font-size: 10px;
    color: #888;
    font-weight: 400;
}
.equip-tooltip .tooltip-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
    color: white;
}
.tooltip-starforce-grid {
    display: grid;
    grid-template-columns: repeat(3, auto);
    gap: 3px 8px;
    margin-bottom: 8px;
    justify-content: start;
}
.tooltip-star-group {
    display: flex;
    gap: 1px;
}
.sf-on { color: #f5a623; font-size: 11px; }
.sf-off { color: #555; font-size: 11px; }
.equip-tooltip .tooltip-section {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.equip-tooltip .tooltip-section-title {
    font-weight: 600;
    margin-bottom: 4px;
}
.tooltip-grade-rare { color: #55b4f5; }
.tooltip-grade-epic { color: #b381e6; }
.tooltip-grade-unique { color: #f5c842; }
.tooltip-grade-legendary { color: #6eff6e; }

/* 상태 뱃지 (잠재능력 등급) */
.equip-pot-badge {
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 700;
}
.pot-rare { background: rgba(85,180,245,0.2); color: #55b4f5; }
.pot-epic { background: rgba(179,129,230,0.2); color: #b381e6; }
.pot-unique { background: rgba(245,200,66,0.2); color: #f5c842; }
.pot-legendary { background: rgba(110,255,110,0.2); color: #6eff6e; }

/* ================================================
   공통
   ================================================ */
.recruit-loading {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 14px;
}
.recruit-empty {
    text-align: center;
    padding: 80px 40px;
    color: #666;
    font-size: 18px;
    font-weight: 600;
    background: white;
    border-radius: 12px;
    border: 1px solid #B4C5E4;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    grid-column: 1 / -1;
}

/* ================================================
   모바일 반응형
   ================================================ */
@media (max-width: 900px) {
    .recruit-grid,
    .my-apps-list,
    .my-recruits-list { grid-template-columns: repeat(2, 1fr); }
    .equip-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .recruit-container { padding: 16px 12px 40px; }
    .recruit-tabs { overflow-x: auto; }
    .recruit-tab { padding: 10px 16px; font-size: 14px; white-space: nowrap; }
    .recruit-grid,
    .my-apps-list,
    .my-recruits-list { grid-template-columns: 1fr; }
    .recruit-filters { flex-direction: column; align-items: stretch; }
    .filter-difficulty-tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
    .filter-selects { flex-wrap: wrap; }
    .filter-selects select { flex: 1; min-width: 100px; }
    .recruit-create-btn { margin-left: 0; }
    .form-row { flex-direction: column; gap: 0; }
    .modal-content { padding: 20px; border-radius: 12px; }
    .modal-large { max-width: 100%; }
    .detail-header { flex-direction: column; gap: 8px; }
    .equip-grid { grid-template-columns: 1fr; }
    .equip-tooltip { left: 10px !important; right: 10px !important; max-width: none; }
    .app-card { flex-direction: column; align-items: flex-start; }
    .app-card-actions { width: 100%; justify-content: flex-end; }

    /* 모바일 신청 모달 전체 화면 */
    #applyModal .modal-content,
    #createModal .modal-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
        height: 100%;
    }
}
