/* ── project.css ── */

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  opacity: 0.2;
} /* common.css 격자보다 살짝 더 어둡게 */

/* ── 상단 네비게이션 ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 15, 20, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 0.12em;
}
.nav-logo::before {
  content: "> ";
  opacity: 0.5;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.nav-logout {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  transition: all 0.15s;
  background: transparent;
}
.nav-logout:hover {
  border-color: var(--red);
  color: var(--red);
}

.nav-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface3);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
}

/* ── 레이아웃 ── */
.layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: calc(100vh - 52px);
}

/* ── 사이드바 (초대목록) ── */
.sidebar {
  border-right: 1px solid var(--border);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-title {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.invite-badge {
  background: var(--orange);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

/* 초대 카드 */
.invite-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.15s;
  animation: fadeUp 0.4s ease both;
}
.invite-card:hover {
  border-color: var(--orange);
}

.invite-project {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.invite-from {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}
.invite-from span {
  color: var(--orange);
}

.invite-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.btn-accept,
.btn-decline {
  flex: 1;
  height: 28px;
  border: none;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition:
    filter 0.15s,
    transform 0.1s;
}
.btn-accept:active,
.btn-decline:active {
  transform: scale(0.96);
}

.btn-accept {
  background: var(--green);
  color: #fff;
}
.btn-accept:hover {
  filter: brightness(1.1);
}

.btn-decline {
  background: var(--red);
  color: #fff;
  border: 1px solid transparent;
}
.btn-decline:hover {
  filter: brightness(1.1);
}

.sidebar-empty {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  padding: 24px 0;
}

/* ── 메인 (프로젝트 목록) ── */
.main {
  padding: 32px 36px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.main-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.main-title {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.main-title span {
  color: var(--green);
}

.main-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

/* 프로젝트 리스트 */
.projects-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 프로젝트 카드 */
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 22px;
  cursor: pointer;
  transition:
    border-color 0.15s,
    transform 0.15s,
    box-shadow 0.15s;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 20px;
  animation: fadeUp 0.4s ease both;
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  background: var(--green);
  opacity: 0;
  transition: opacity 0.2s;
}

.project-card:hover {
  border-color: #3d4450;
  transform: translateX(2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}
.project-card:hover::before {
  opacity: 1;
}

.project-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.project-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.project-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.project-owner {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.owner-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

/* + 새 프로젝트 버튼 */
.project-add {
  background: transparent;
  border: 1px dashed #3d4450;
  border-radius: 10px;
  padding: 16px 22px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 58px;
}
.project-add:hover {
  border-color: var(--orange);
  background: rgba(249, 115, 22, 0.04);
}

.add-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--orange);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  font-weight: 300;
  line-height: 1;
  transition: transform 0.2s;
}
.project-add:hover .add-circle {
  transform: scale(1.1) rotate(90deg);
}

.add-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  transition: color 0.2s;
}
.project-add:hover .add-label {
  color: var(--orange);
}

/* ── 모달 ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px;
  width: 480px;
  max-width: 90vw;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.25s ease;
  position: relative;
}
.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
}

.modal-corner {
  position: absolute;
  top: 0;
  right: 0;
  width: 50px;
  height: 50px;
  border-top: 2px solid var(--orange);
  border-right: 2px solid var(--orange);
  border-radius: 0 12px 0 0;
  opacity: 0.5;
}

.modal-title {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.modal-title span {
  color: var(--orange);
}

.modal-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 28px;
  font-family: var(--font-mono);
}

.modal-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  margin-bottom: 6px;
}

.modal-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 11px 14px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  margin-bottom: 16px;
}
.modal-input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.modal-textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 14px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  outline: none;
  resize: none;
  height: 130px;
  line-height: 1.6;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  margin-bottom: 24px;
}
.modal-textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.modal-textarea::placeholder,
.modal-input::placeholder {
  color: var(--text-dim);
}

.modal-actions {
  display: flex;
  gap: 10px;
}

.btn-create {
  flex: 1;
  height: 46px;
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(249, 115, 22, 0.3);
  transition:
    filter 0.15s,
    transform 0.1s;
}
.btn-create:hover {
  filter: brightness(1.08);
}
.btn-create:active {
  transform: scale(0.98);
}

.btn-cancel {
  height: 46px;
  padding: 0 20px;
  background: var(--surface2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-cancel:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

.modal-status {
  margin-top: 10px;
  font-size: 11px;
  font-family: var(--font-mono);
  text-align: center;
  min-height: 14px;
}
.modal-status.error {
  color: var(--red);
}
.modal-status.success {
  color: var(--green);
}
