/* 랭킹 페이지 래퍼 */
.rank-page-wrap{
  max-width:1200px;
  margin:85px auto;
  padding:0 16px;
  color:#f5f5f5;
}
.rank-page-inner{
  width:100%;
}
.rank-header{
  margin-bottom:16px;
}
.rank-title{
  font-size:22px;
  font-weight:700;
  margin:0 0 4px 0;
}
.rank-subtitle{
  font-size:13px;
  color:#a0a0aa;
  margin:0;
}

/* 카테고리 탭 – 심플 둥근 사각 버튼 */
.rank-tabs{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:18px 0 16px;
}

.rank-tab{
  display:inline-flex;
  align-items:center;
  justify-content:center;

  padding:7px 14px;
  font-size:14px;
  font-weight:700;
  text-decoration:none;

  border-radius:10px;
  border:1px solid #2a2a35;

  background:#14141c;
  color:#fbfbfb;             /* 비활성 글자 */

  transition:
    background .18s ease,
    border-color .18s ease,
    color .18s ease,
    transform .12s ease;
}

/* Hover - 비활성만 미세 반응 */
.rank-tab:hover{
  background:#1b1b22;
  border-color:#3a3a45;
  color:#ffffff;
  transform:translateY(-1px);
}

/* 활성 탭 */
.rank-tab.is-active{
  background:#14141c;        /* 배경 유지 */
  border-color:#5fb4ff;      /* 활성 테두리 */
  color:#5fb4ff;             /* 활성 글자 */
  transform:none;
}


.rank-section-title{
  font-size:16px;
  margin:8px 0 12px;
}

/* 테이블 */
.rank-table-wrap{
  border-radius:18px;
  background:#141419;
  border:1px solid rgba(255,255,255,.08);
  box-shadow:0 10px 30px rgba(0,0,0,.6);
  overflow:hidden;
}
.rank-table{
  width:100%;
  border-collapse:collapse;
  font-size:13px;
}
.rank-table thead{
  background:#181820;
}
.rank-table th,
.rank-table td{
  padding:9px 10px;
  border-bottom:1px solid rgba(255,255,255,.04);
}
.rank-table th{
  text-align:left;
  font-weight:600;
  color:#c8c8d4;
}
.rank-row:hover{
  background:rgba(255,255,255,.02);
}

.col-rank{
  width:48px;
  text-align:center;
}
.col-site{
  width:40%;
}
.col-change{
  width:100px;
}
.col-meta{
  width:auto;
}

/* 사이트 셀 */
.site-cell{
  display:flex;
  align-items:center;
  gap:8px;
}
.site-fav img{
  width:24px;
  height:24px;
  border-radius:6px;
  display:block;
}
.site-main{
  display:flex;
  flex-direction:column;
  gap:2px;
  min-width:0;
}
/* 햄버거 모달 버튼 (동그라미 안에 ☰) */
.rank-name-btn{
  cursor:pointer;

  /* 동그라미 버튼 기본 형태 */
  width:34px;
  height:34px;
  border-radius:50%;
  border:1px solid rgba(255,255,255,.14);

  display:inline-flex;
  align-items:center;
  justify-content:center;

  /* 배경/테두리/텍스트 기본값 */
  background:transparent;
  color:#f5f5ff;
  font-size:14px;
  line-height:1;

  /* 버튼 기본 스타일/언더라인 제거 */
  padding:0;
  margin:0;
  box-shadow:none;
  -webkit-appearance:none;
  appearance:none;
  text-decoration:none !important;

  transition:border-color .15s ease;
}

/* 호버 시: 테두리만 파란색, 밑줄 없음 */
.rank-name-btn:hover,
.rank-name-btn:focus{
  border-color:#0b6cff;
  text-decoration:none !important;
}



/* 공통 모달 열기 버튼 */
.rank-open-btn{
  cursor:pointer;
  border:none;
  background:transparent;
  padding:0;
}

/* site_rankings.php — 텍스트 버튼 */
.rank-text-btn{
  color:#f5f5ff;
  font-size:13px;
  font-weight:600;
  text-decoration:none !important;
}
.rank-text-btn:hover{
  color:#0b6cff;
}

/* design.php — 동그라미 햄버거 버튼 */
.rank-circle-btn{
  width:26px;
  height:26px;
  border-radius:50%;
  border:1px solid rgba(255,255,255,.14);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:14px;
  line-height:1;
}
.rank-circle-btn:hover{
  border-color:#0b6cff;
}








.site-url{
  font-size:11px;
  color:#787887;
  max-width:320px;
  white-space:nowrap;
  text-overflow:ellipsis;
  overflow:hidden;
}

/* 증가율 */
.change-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:54px;
  padding:2px 8px;
  border-radius:999px;
  font-size:12px;
  font-variant-numeric:tabular-nums;
  background:#22222a;
  color:#d0d0da;
}
.change-badge.up{
  background:rgba(34,197,94,.1);
  color:#4ade80;
}
.change-badge.down{
  background:rgba(248,113,113,.1);
  color:#fca5a5;
}
.change-badge.flat{
  background:rgba(148,163,184,.1);
  color:#cbd5f5;
}

/* 빈 상태 */
.rank-empty{
  margin-top:16px;
  font-size:13px;
  color:#a0a0aa;
}

/* 모달 공통 */
.rank-modal{
  position:fixed;
  inset:0;
  z-index:10040;
  display:none;
}
.rank-modal.is-open{
  display:block;
}
.rank-modal-backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.6);
}
.rank-modal-dialog{
  position:absolute;
  top:50%;
  left:50%;
  width:900px;
  max-width:95vw;
  max-height:90vh;
  transform:translate(-50%,-50%);
  background:#0f1015;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.08);
  box-shadow:0 20px 60px rgba(0,0,0,.75);
  overflow:hidden;
}
.rank-modal-close{
  position:absolute;
  top:-13px;
  right:8px;
  padding:0;
  background:transparent;
  border:none;
  color:#888;
  font-size:32px;
  cursor:pointer;
}
.rank-modal-close:hover{
  color:#fff;
}

.rank-modal-body{
  display:flex;
  gap:18px;
  padding:18px 18px 18px 18px;
}
.rank-modal-main{
  flex:2;
  min-width:0;
}
.rank-modal-side{
  flex:1;
  min-width:0;
}
/* 모달 - 가격유형 영역 */
.rank-modal-price{
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:10px;
  font-size:13px;
}

.rank-price-label{
  color:#a1a1b5;
  font-weight:500;
}

.rank-price-value{
  color:#ffffff;
  font-weight:600;
}

/* 운영자용 select */
.rank-price-select{
  margin-left:8px;
  padding:4px 8px;
  border-radius:6px;
  border:1px solid #2a2a35;
  background:#14141c;
  color:#ffffff;
  font-size:12px;
}





/* 모달 헤더 */
.rank-modal-header{
  display:flex;
  gap:10px;
  margin-bottom:10px;
}
.rank-modal-fav img{
  width:32px;
  height:32px;
  border-radius:8px;
}
.rank-modal-title-wrap{
  display:flex;
  flex-direction:column;
  gap:2px;
}
.rank-modal-name{
  font-size:16px;
  font-weight:700;
  margin:0;
}
.rank-modal-meta{
  font-size:12px;
  color:#a0a0aa;
  margin:0;
}



/* WYSIWYG 툴바 */
.rank-editor-toolbar{
  display:flex;
  gap:6px;
  margin-bottom:8px;
}

.rank-editor-btn{
  all:unset;
  padding:6px 10px;
  border-radius:6px;
  background:#1b1b22;
  border:1px solid #2f2f3b;
  color:#ffffff;
  font-size:12px;
  font-weight:700;
  cursor:pointer;
  text-align:center;
}

.rank-editor-btn:hover{
  background:#26262f;
  border-color:#3c3c48;
}


/* 모달 - 사이트 바로가기 버튼 스타일 (고정 사이즈) */
.rank-modal-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;

  width:110px;         /* 고정 가로 */
  height:36px;         /* 고정 세로 */
  
  border-radius:8px;
  background:#0b6cff;  /* 지정 파란색 */
  color:#ffffff;       /* 흰 글씨 */
  font-weight:600;
  font-size:13px;
  text-decoration:none;

  transition:background .18s ease;
}

/* hover */
.rank-modal-link:hover{
  background:#0a60e0;  /* 살짝 어두운 파란색 */
  color:#ffffff;
}


/* 태그 칩 */
.rank-modal-tags{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin:8px 0 10px;
}
.rank-tag-chip{
  display:inline-flex;
  align-items:center;
  padding:3px 9px;
  border-radius:999px;
  border:1px solid rgba(148,163,184,.5);
  font-size:11px;
  color:#e5e7eb;
}

/* 설명 */
.rank-modal-desc-block{
  margin-top:8px;
}
.rank-modal-desc-view{
  font-size:13px;
  line-height:1.5;
  color:#e5e5ef;
  white-space:pre-wrap;
  border-radius:10px;
  padding:10px 11px;
  background:#181820;
}
.rank-modal-desc-view.is-empty{
  color:#6b7280;
  font-style:italic;
}
.rank-modal-desc-edit{
  margin-top:6px;
}
.rank-modal-desc-edit textarea{
  width:100%;
  box-sizing:border-box;
  resize:vertical;
  border-radius:10px;
  border:1px solid #3f3f46;
  background:#020617;
  color:#e5e7eb;
  font-size:13px;
  padding:8px 9px;
}
.rank-modal-desc-actions{
  display:flex;
  justify-content:flex-end;
  gap:6px;
  margin-top:6px;
}

/* 버튼 공통 */
.btn-primary,
.btn-ghost,
.btn-small{
  font-size:12px;
  border-radius:999px;
  padding:4px 10px;
  border:1px solid transparent;
  cursor:pointer;
}
.btn-primary{
  background:#2563eb;
  color:#fff;
  border-color:#2563eb;
}
.btn-primary:hover{
  background:#1d4ed8;
}
.btn-ghost{
  background:transparent;
  color:#e5e7eb;
  border-color:#4b5563;
}
.btn-ghost:hover{
  background:#111827;
}
.btn-small{
  padding:3px 9px;
  margin-top:6px;
}

/* 썸네일 */
.rank-modal-thumb-wrap{
  width:100%;
  border-radius:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:220px;
  overflow:hidden;
}
.rank-modal-thumb-wrap img{
  width:100%;
  height:100%;
  object-fit:cover;
}


/* 설명 입력 textarea 스크롤 가능하게 */
#rm-desc-input{
  width:100%;
  height:600px;             /* 고정 높이 */
  padding:10px;
  border-radius:8px;
  border:1px solid #2a2a35;
  background:#14141c;
  color:#fff;
  font-size:13px;
  line-height:1.5;
  resize:vertical;          /* 크기 조절 가능 (원하면 none으로 고정가능) */
  overflow-y:auto;          /* 스크롤 활성화 */
}

/* 설명 VIEW 영역도 길면 스크롤 */
#rm-desc-view{
  max-height:660px;         /* 너무 길어지면 내부 스크롤 */
  overflow-y:auto;
  padding-right:8px;
}


.change-badge.new{
  background:rgba(59,130,246,.15);  /* 파란 느낌 */
  color:#93c5fd;
}


/* 모바일 대응 */
@media (max-width:1024px){
  .rank-modal-dialog{
    top:50%;
    left:50%;
    transform:translate(-50%,-50%);
    width:100%;
    max-width:100%;
    max-height:100vh;
    border-radius:0;
  }
  .rank-modal-body{
    flex-direction:column;
  }
}


/* 1024px 이하 – Meta Title 컬럼 숨김 */
@media (max-width:1024px){
  .col-meta{
    display:none !important;
  }
}
