/* =====================================================
   Layout Components
   ===================================================== */

/* Landing Page Container - Free Scroll */
.landing-container {
  width: 100%;
  height: 100dvh;
  overflow-y: scroll;
  overflow-x: hidden;
  background-color: var(--color-bg-darker);
}

.landing-section {
  background: var(--Color-teal-800, #002224);
  min-height: 100dvh;
  width: 100%;
}

/* Page Container */
.page-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: var(--spacing-page);
  overflow: hidden;
  background-color: #002224;
  position: relative;
}

@media (min-width: 768px) {
  .page-container {
    padding: var(--spacing-page-md);
  }
}

/* Page Container - Full Height with Background */
.page-container-full {
  width: 100%;
  min-height: 100dvh;
  color: var(--color-text-white);
  display: flex;
  flex-direction: column;
  padding: var(--spacing-page);
  background-color: var(--color-bg-dark);
}

@media (min-width: 768px) {
  .page-container-full {
    padding: var(--spacing-page-md);
  }
}

@media (min-width: 1024px) {
  .page-container-full {
    padding: 2.5rem;
  }
}

/* Wizard Page Container - 단계별 페이지 전환용 */
.wizard-page-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background-color: #002224;
  overflow-y: auto;
}

/* Main Content Area */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 72rem;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  min-height: 0;
  overflow: hidden;
}

@media (min-width: 1024px) {
  .main-content {
    flex-direction: row;
  }
}

/* Dashboard Layout */
.dashboard-layout {
  display: flex;
  width: 100%;
  min-height: 100dvh;
  background-color: var(--color-bg-darker);
  color: var(--color-text-white);
}

.dashboard-content {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow-y: auto;
  padding-left: 0;
}

/* =====================================================
   Card Components
   ===================================================== */

/* Base Card */
.card {
  background-color: var(--color-bg-card);
  border-radius: var(--radius-3xl);
  padding: var(--spacing-page);
  border: 1px solid var(--color-border-white-5);
  box-shadow: var(--shadow-xl);
}

@media (min-width: 768px) {
  .card {
    padding: var(--spacing-page-md);
  }
}

/* Card Variants */
.card-flex {
  display: flex;
  flex-direction: column;
}

.card-flex-1 {
  flex: 1;
}

.card-flex-2 {
  flex: 2;
}

.card-overflow-hidden {
  overflow: hidden;
}

/* Card Inner (Darker Background) */
.card-inner {
  background-color: rgba(18, 26, 29, 0.5);
  border-radius: var(--radius-2xl);
  border: 1px solid var(--color-border-white-5);
  padding: 1rem;
}

/* =====================================================
   Header Components
   ===================================================== */

/* Page Header */
.page-header {
  text-align: center;
  margin-bottom: 2rem;
  flex-shrink: 0;
}

/* Page Title */
.page-title {
  font-size: var(--text-3xl);
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.025em;
}

@media (min-width: 768px) {
  .page-title {
    font-size: var(--text-4xl);
  }
}

/* Page Subtitle */
.page-subtitle {
  color: var(--color-text-gray-400);
  font-size: var(--text-base);
}

@media (min-width: 768px) {
  .page-subtitle {
    font-size: var(--text-lg);
  }
}

/* Section Title (Mint color uppercase) */
.section-title {
  color: #94FBE0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.006em;
  margin-bottom: 0;
  flex-shrink: 0;
}

/* Section Title Purple */
.section-title-purple {
  color: #AE72F9;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.006em;
  margin-bottom: 0;
  display: block;
}

/* =====================================================
   Button Components
   ===================================================== */

/* Primary Button (Purple) */
.btn-primary {
  background-color: var(--color-purple);
  color: var(--color-text-white);
  font-weight: 700;
  padding: 1rem 4rem;
  border-radius: var(--radius-full);
  transition: all var(--transition-normal);
  transform: scale(1);
  box-shadow: var(--shadow-purple);
  font-size: var(--text-lg);
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  background-color: var(--color-purple-hover);
}

.btn-primary:active {
  transform: scale(0.95);
}

.btn-primary:disabled {
  background-color: #4b5563;
  color: var(--color-text-gray-400);
  cursor: not-allowed;
  box-shadow: none;
}

/* Secondary Button (Mint) */
.btn-secondary {
  background-color: var(--color-mint);
  color: var(--color-bg-dark);
  font-weight: 700;
  padding: 1rem;
  border-radius: var(--radius-xl);
  transition: all var(--transition-normal);
  transform: scale(1);
  font-size: var(--text-base);
  border: none;
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-secondary:hover {
  background-color: var(--color-mint-hover);
}

.btn-secondary:active {
  transform: scale(0.98);
}

.btn-secondary:disabled {
  background-color: rgba(166, 255, 234, 0.5);
  color: rgba(18, 26, 29, 0.5);
  cursor: not-allowed;
}

/* Outline Button */
.btn-outline {
  background-color: transparent;
  border: 1px solid var(--color-border-gray-600);
  color: var(--color-text-white);
  font-weight: 700;
  padding: 1rem 4rem;
  border-radius: var(--radius-full);
  transition: all var(--transition-normal);
  font-size: var(--text-base);
  cursor: pointer;
}

.btn-outline:hover {
  border-color: var(--color-text-gray-500);
}

/* Back Button */
.btn-back {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border-gray-600);
  background-color: transparent;
  color: var(--color-text-gray-300);
  font-size: var(--text-base);
  transition: background-color var(--transition-normal);
  cursor: pointer;
}

.btn-back:hover {
  background-color: rgba(31, 41, 55, 1);
}

/* Regenerate Button (Mint Outline) */
.btn-regenerate {
  margin-top: 1rem;
  width: 100%;
  padding: 0.75rem;
  background-color: var(--color-mint-20);
  color: var(--color-mint);
  border: 1px solid var(--color-mint-30);
  font-weight: 700;
  border-radius: var(--radius-xl);
  transition: background-color var(--transition-normal);
  font-size: var(--text-base);
  flex-shrink: 0;
  cursor: pointer;
}

.btn-regenerate:hover {
  background-color: var(--color-mint-30);
}

.btn-regenerate:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Selection Button */
.btn-select {
  padding: 0.75rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border-gray-700);
  background-color: rgba(18, 26, 29, 0.4);
  color: var(--color-text-gray-400);
  font-size: var(--text-sm);
  font-weight: 700;
  transition: all var(--transition-normal);
  cursor: pointer;
}

.btn-select:hover {
  border-color: var(--color-border-gray-600);
}

.btn-select.active {
  border-color: var(--color-mint);
  background-color: var(--color-bg-dark);
  color: var(--color-mint);
}

.btn-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* =====================================================
   Form Components
   ===================================================== */

/* Select Input */
.select-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-xl);
  background-color: var(--color-bg-dark);
  border: 1px solid var(--color-border-gray-700);
  font-size: var(--text-base);
  color: var(--color-text-gray-300);
}

.select-input:focus {
  outline: none;
  border-color: var(--color-mint);
}

.select-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Text Input */
.text-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-xl);
  background-color: var(--color-bg-dark);
  border: 1px solid var(--color-border-gray-700);
  font-size: var(--text-base);
  color: var(--color-text-gray-300);
}

.text-input:focus {
  outline: none;
  border-color: var(--color-mint);
}

/* Textarea - Lyrics */
.textarea-lyrics {
  flex: 1;
  overflow-y: auto;
  font-size: var(--text-sm);
  color: var(--color-text-gray-400);
  background-color: transparent;
  resize: none;
  border: none;
  padding-right: 0.5rem;
  line-height: 1.625;
  min-height: 0;
}

.textarea-lyrics:focus {
  outline: none;
  color: var(--color-text-gray-300);
}

/* =====================================================
   Navigation Components
   ===================================================== */

/* Back Button Container */
.back-button-container {
  width: 100%;
  max-width: 1040px;
  display: flex;
  justify-content: flex-start;
  margin-bottom: 1.5rem;
  flex-shrink: 0;
}

/* Bottom Button Container */
.bottom-button-container {
  position: fixed;
  bottom: 32px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 30;
  pointer-events: none;
}

.bottom-button-container > * {
  pointer-events: all;
}

@media (min-width: 768px) {
  .bottom-button-container {
    left: 240px;
  }
}

/* =====================================================
   Sidebar Components
   ===================================================== */

/* Sidebar Container */
.sidebar {
  position: fixed;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--color-bg-dark);
  border-right: 1px solid var(--color-border-white-5);
  transition: all var(--transition-slow);
  z-index: 50;
}

@media (min-width: 768px) {
  .sidebar {
    position: sticky;
    top: 0;
    flex-shrink: 0;
  }
}

.sidebar.expanded {
  width: 15rem;
}

.sidebar.collapsed {
  width: 5rem;
}

.sidebar.mobile-open {
  transform: translateX(0);
}

.sidebar.mobile-closed {
  transform: translateX(-100%);
}

@media (min-width: 768px) {
  .sidebar.mobile-closed {
    transform: translateX(0);
  }
}

/* Sidebar Header */
.sidebar-header {
  padding: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-header.collapsed {
  flex-direction: column;
  gap: 1rem;
}

/* Sidebar Logo */
.sidebar-logo {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--color-text-white);
  cursor: pointer;
  transition: color var(--transition-normal);
}

.sidebar-logo:hover {
  color: var(--color-mint);
}

/* Sidebar Menu */
.sidebar-menu {
  flex: 1;
  padding: 0 0.75rem;
  margin-top: 1rem;
  overflow-y: auto;
}

/* Sidebar Menu Item */
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-xl);
  transition: all var(--transition-normal);
  cursor: pointer;
  margin-bottom: 0.25rem;
  position: relative;
  overflow: hidden;
}

.sidebar-item.collapsed {
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin-left: auto;
  margin-right: auto;
  padding: 0;
}

.sidebar-item.active {
  background-color: var(--color-mint);
  color: var(--color-bg-dark);
}

.sidebar-item:not(.active) {
  color: var(--color-text-gray-400);
}

.sidebar-item:not(.active):not(.disabled):hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--color-text-white);
}

.sidebar-item.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.sidebar-item-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-normal);
}

.sidebar-item.active .sidebar-item-icon {
  color: var(--color-bg-dark);
}

.sidebar-item-label {
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 1rem;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Credit Card */
.credit-card {
  background-color: var(--color-bg-card);
  border-radius: var(--radius-2xl);
  padding: 1rem;
  border: 1px solid var(--color-border-white-5);
}

.credit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.credit-label {
  color: var(--color-text-gray-400);
  font-size: var(--text-sm);
  font-weight: 500;
}

.credit-value {
  color: var(--color-text-white);
  font-size: var(--text-sm);
  font-weight: 700;
}

.credit-bar {
  width: 100%;
  height: 0.375rem;
  background-color: #1f2937;
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.credit-bar-fill {
  height: 100%;
  background-color: var(--color-mint);
}

.credit-upgrade-btn {
  width: 100%;
  padding: 0.625rem;
  background-color: var(--color-bg-dark);
  color: var(--color-text-white);
  font-size: var(--text-sm);
  font-weight: 700;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-gray-700);
  transition: background-color var(--transition-normal);
  cursor: pointer;
}

.credit-upgrade-btn:hover {
  background-color: #1f2937;
}

/* Profile Section */
.profile-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 0.5rem;
}

.profile-section.collapsed {
  flex-direction: column;
}

.profile-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border-gray-700);
  object-fit: cover;
}

.profile-avatar-default {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-bg-gray-700);
  color: var(--color-text-gray-400);
}

.profile-name {
  color: var(--color-text-white);
  font-size: var(--text-sm);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-credits {
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  font-weight: 500;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Sidebar Language Switch */
.sidebar-language-switch {
  padding: 0 1rem 0.75rem;
  display: flex;
  justify-content: flex-start;
}

/* Toggle container */
.lang-toggle {
  position: relative;
  display: flex;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 2px;
  width: 100%;
  max-width: 120px;
}

.lang-toggle-option {
  flex: 1;
  position: relative;
  z-index: 1;
  padding: 4px 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.4);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.3s ease;
  text-align: center;
}

.lang-toggle-option.active {
  color: #ffffff;
}

.lang-toggle-option:hover:not(.active) {
  color: rgba(255, 255, 255, 0.6);
}

/* Sliding indicator */
.lang-toggle-slider {
  position: absolute;
  top: 2px;
  bottom: 2px;
  width: calc(50% - 2px);
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.lang-toggle-slider.left {
  transform: translateX(2px);
}

.lang-toggle-slider.right {
  transform: translateX(calc(100% + 2px));
}

/* Collapsed state - simple button */
.lang-toggle-collapsed {
  padding: 4px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.lang-toggle-collapsed:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
}

/* Sidebar Footer Actions */
.sidebar-footer-actions {
  display: flex;
  flex-direction: column;
}

.sidebar-footer-actions .logout-btn {
  width: 100%;
}

.sidebar-inquiry-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--color-text-gray-400);
  text-decoration: none;
  transition: color var(--transition-normal);
  white-space: nowrap;
  font-size: var(--text-sm);
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-inquiry-btn:hover {
  color: var(--color-text-white);
}

.sidebar-inquiry-btn.collapsed {
  justify-content: center;
  padding: 0.75rem;
}

/* Logout Button */
.logout-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--color-text-gray-400);
  background: none;
  border: none;
  transition: color var(--transition-normal);
  cursor: pointer;
}

.logout-btn:hover {
  color: var(--color-text-white);
}

.logout-btn.collapsed {
  justify-content: center;
}

.logout-btn-label {
  font-size: var(--text-sm);
  font-weight: 700;
}

/* 모바일 전용 사이드바 튜토리얼 토글 */
.sidebar-tutorial-btn {
  display: none;
}

@media (max-width: 767px) {
  .sidebar-tutorial-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.75rem;
    border-radius: var(--radius-lg);
    color: var(--color-text-gray-400);
    border: none;
    background: none;
    cursor: pointer;
    font-size: var(--text-sm);
    font-weight: 500;
    transition: color var(--transition-normal), background-color var(--transition-normal);
  }

  .sidebar-tutorial-btn:hover {
    color: var(--color-text-white);
    background-color: rgba(255, 255, 255, 0.05);
  }

  .sidebar-tutorial-btn.active {
    color: var(--color-mint);
  }

  .sidebar-tutorial-label {
    text-align: left;
  }

  .sidebar-tutorial-badge {
    font-size: 11px;
    font-weight: 700;
  }

  .sidebar-tutorial-badge.on {
    color: var(--color-mint);
  }

  .sidebar-tutorial-badge.off {
    color: var(--color-text-gray-400);
  }
}

/* Mobile Menu Button */
.mobile-menu-btn {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 40;
  padding: 0.625rem;
  background-color: var(--color-bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-white-10);
  color: var(--color-text-gray-400);
  cursor: pointer;
}

.mobile-menu-btn:hover {
  color: var(--color-text-white);
}

@media (min-width: 768px) {
  .mobile-menu-btn {
    display: none;
  }
}

/* Mobile Overlay */
.mobile-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 40;
}

@media (min-width: 768px) {
  .mobile-overlay {
    display: none;
  }
}

