/* ============================================
   BOTT.MARKET Login Page Styles
   ============================================ */

:root {
  --bg-primary: #0a0a10;
  --bg-card: rgba(255, 255, 255, 0.03);
  --border-card: rgba(255, 255, 255, 0.08);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.5);
  --text-tertiary: rgba(255, 255, 255, 0.3);
  --accent: #8B8CF8;
  --gradient-start: #318CC4;
  --gradient-end: #3CB8A9;
  --error: #ef4444;
  --success: #22c55e;
  --input-bg: rgba(255, 255, 255, 0.05);
  --input-border: rgba(255, 255, 255, 0.1);
  --input-focus-border: rgba(139, 140, 248, 0.5);
  --transition: 0.2s ease;
}

/* Reset */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont,
    'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 로그인 페이지 body */
body.page-login {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* 로그인 컨테이너 */
.login-container {
  width: 100%;
  max-width: 420px;
}

/* 로그인 카드 */
.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
}

/* 카드 상단 그라디언트 라인 */
.login-card::before {
  content: '';
  display: block;
  height: 2px;
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
  opacity: 0.85;
}

.login-card-inner {
  padding: 40px 32px 32px;
}

/* 로고 */
.logo {
  text-align: center;
  margin-bottom: 32px;
}

.logo-img {
  height: 36px;
  width: auto;
  display: inline-block;
}

.logo-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* 성공 메시지 */
.success-message {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 8px;
}

.success-message svg {
  flex-shrink: 0;
}

/* 에러 메시지 */
.error-message {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--error);
  display: flex;
  align-items: center;
  gap: 8px;
}

.error-message svg {
  flex-shrink: 0;
}

/* 폼 그룹 */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* 입력 필드 */
.input-wrapper {
  position: relative;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition), background var(--transition);
}

.form-input::placeholder {
  color: var(--text-tertiary);
}

.form-input:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.form-input:focus {
  border-color: var(--input-focus-border);
  background: rgba(255, 255, 255, 0.07);
}

/* 비밀번호 입력 */
.input-wrapper .form-input {
  padding-right: 48px;
}

/* 비밀번호 토글 버튼 */
.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-tertiary);
  transition: color var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle:hover {
  color: var(--text-secondary);
}

.password-toggle svg {
  width: 20px;
  height: 20px;
}

.password-toggle .icon-eye-off {
  display: none;
}

.password-toggle.active .icon-eye {
  display: none;
}

.password-toggle.active .icon-eye-off {
  display: block;
}

/* 체크박스 */
.checkbox-group {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
}

.checkbox-input {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  background: var(--input-bg);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: border-color var(--transition), background var(--transition);
}

.checkbox-input:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.checkbox-input:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.checkbox-input:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 6px;
  height: 10px;
  border: solid var(--text-primary);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-left: 10px;
  cursor: pointer;
  user-select: none;
}

/* 로그인 버튼 */
.login-button {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  border: none;
  border-radius: 10px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
}

.login-button:hover {
  opacity: 0.9;
}

.login-button:active {
  transform: scale(0.98);
}

/* 카피라이트 */
.copyright {
  text-align: center;
  margin-top: 24px;
  font-size: 12px;
  color: var(--text-tertiary);
}

/* 반응형 */
@media (max-width: 480px) {
  .login-card-inner {
    padding: 32px 24px 24px;
  }

  .logo-text {
    font-size: 24px;
  }

  .login-container {
    max-width: 100%;
  }
}

@media (max-width: 360px) {
  body {
    padding: 16px;
  }

  .login-card-inner {
    padding: 28px 20px 20px;
  }
}

/* ============================================
   Dashboard Styles
   ============================================ */

.dashboard-container {
  min-height: 100vh;
  background: var(--bg-primary);
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-logo {
  height: 28px;
  width: auto;
}

.header-logo-text {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 18px;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-info {
  font-size: 13px;
  color: var(--text-secondary);
}

.btn-logout {
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  text-decoration: none;
  transition: all var(--transition);
}

.btn-logout:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.gradient-line {
  height: 1px;
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
  opacity: 0.85;
}

.dashboard-main {
  padding: 32px;
  max-width: 1200px;
  margin: 0 auto;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}

.section-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-header {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}

/* 카드 */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  overflow: hidden;
}

.card-gradient-line {
  height: 2px;
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
  opacity: 0.85;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  padding: 20px 20px 0;
  margin-bottom: 16px;
}

/* 테이블 */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  text-align: left;
  padding: 10px 20px;
  color: var(--text-secondary);
  font-weight: 500;
  border-bottom: 1px solid var(--border-card);
  white-space: nowrap;
}

td {
  padding: 10px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
}

tr:last-child td {
  border-bottom: none;
}

.empty-row {
  text-align: center;
  color: var(--text-tertiary);
  padding: 24px 20px !important;
}

/* 뱃지 */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.badge-success {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.badge-error {
  background: rgba(239, 68, 68, 0.15);
  color: var(--error);
}

/* ============================================
   Bot Card Grid
   ============================================ */

.bot-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* 봇 카드 공통 */
.bot-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color var(--transition);
  position: relative;
}

.bot-card:hover {
  border-color: rgba(255, 255, 255, 0.16);
}

/* 카드 상단 그라디언트 라인 */
.bot-card-gradient {
  height: 2px;
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
  opacity: 0.85;
}

.bot-card-body {
  padding: 20px;
}

/* 카드 헤더 (아이콘 + 상태 뱃지) */
.bot-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* 봇 아이콘 */
.bot-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bot-icon--naver {
  background: #03C75A;
}

.bot-icon--coupang {
  background: #E4002B;
}

.bot-icon--naverblog {
  background: #19CE60;
}

.bot-icon--smartstore {
  background: #FF6F00;
}

.bot-icon--wordpress {
  background: #21759B;
}

.bot-icon--baemin {
  background: #2AC1BC;
}

.bot-icon--tax {
  background: #4A6CF7;
}

.bot-icon--kakao {
  background: #FEE500;
}

.bot-icon--kakao svg path {
  fill: #3C1E1E;
}

.bot-icon--instagram {
  background: linear-gradient(135deg, #F58529, #DD2A7B, #8134AF);
}

.bot-icon--report {
  background: #10B981;
}

.bot-icon--order {
  background: #6366F1;
}

/* ============================================
   리본 뱃지 (HOT / NEW / BEST)
   ============================================ */

.bot-ribbon {
  position: absolute;
  top: 14px;
  right: -30px;
  width: 110px;
  text-align: center;
  padding: 4px 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #ffffff;
  transform: rotate(45deg);
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.bot-ribbon--hot {
  background: linear-gradient(135deg, #FF4D4D, #FF1A1A);
}

.bot-ribbon--new {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
}

.bot-ribbon--best {
  background: linear-gradient(135deg, #F59E0B, #EF7B10);
}

/* ============================================
   가격 표시
   ============================================ */

.bot-card-pricing {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 16px;
}

.bot-price-monthly {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.bot-price-monthly small {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary);
}

.bot-price-permanent {
  font-size: 11px;
  color: var(--text-tertiary);
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  white-space: nowrap;
}

/* 상태 뱃지 */
.bot-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}

.bot-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.bot-status--active {
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
}

.bot-status--active::before {
  background: var(--success);
}

.bot-status--beta {
  background: rgba(139, 140, 248, 0.12);
  color: var(--accent);
}

.bot-status--beta::before {
  background: var(--accent);
}

.bot-status--pending {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}

.bot-status--pending::before {
  background: #f59e0b;
}

/* 봇 이름 */
.bot-card-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary);
}

/* 봇 설명 */
.bot-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}

/* 간단 통계 */
.bot-card-stats {
  display: flex;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid var(--border-card);
}

.bot-stat {
  flex: 1;
  text-align: center;
}

.bot-stat-value {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.bot-stat-label {
  display: block;
  font-size: 11px;
  color: var(--text-tertiary);
}

.bot-stat-divider {
  width: 1px;
  height: 28px;
  background: var(--border-card);
}

/* 새 봇 추가 카드 */
.bot-card--add {
  border-style: dashed;
  cursor: default;
}

.bot-card--add:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.bot-card-add-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  gap: 12px;
}

.bot-add-icon {
  opacity: 0.5;
}

.bot-add-text {
  font-size: 14px;
  color: var(--text-tertiary);
}

/* 반응형 - 봇 그리드 */
@media (max-width: 1200px) {
  .bot-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .bot-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .bot-grid {
    grid-template-columns: 1fr;
  }
}
