/**
 * DREAM Exchange - Design System
 * モダンで洗練されたダークテーマのデザインシステム
 */

/* ==================== CSS Variables ==================== */
:root {
  /* Primary Colors */
  --primary-cyan: #00E5CC;
  --primary-cyan-hover: #00FFE0;
  --primary-cyan-dark: #00C4AD;

  /* Background Colors */
  --bg-dark: #0A0E27;
  --bg-darker: #070B1F;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.05);
  --bg-input: rgba(255, 255, 255, 0.05);

  /* Text Colors */
  --text-primary: #FFFFFF;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-tertiary: rgba(255, 255, 255, 0.5);
  --text-muted: rgba(255, 255, 255, 0.3);

  /* Status Colors */
  --success: #00E5CC;
  --success-bg: rgba(0, 229, 204, 0.1);
  --error: #FF6B6B;
  --error-bg: rgba(255, 107, 107, 0.1);
  --warning: #FFA500;
  --warning-bg: rgba(255, 165, 0, 0.1);
  --pending: #FFD700;
  --pending-bg: rgba(255, 215, 0, 0.1);

  /* Positive/Negative */
  --positive: #00E5CC;
  --positive-light: #00FFE0;
  --negative: #FF6B6B;
  --negative-light: #FF8585;

  /* Border Colors */
  --border-light: rgba(255, 255, 255, 0.1);
  --border-medium: rgba(255, 255, 255, 0.15);
  --border-strong: rgba(255, 255, 255, 0.2);
  --border-cyan: rgba(0, 229, 204, 0.3);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-cyan: 0 4px 24px rgba(0, 229, 204, 0.2);

  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Font Sizes */
  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-md: 16px;
  --text-lg: 18px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 32px;
  --text-4xl: 48px;

  /* Font Weights */
  --weight-light: 300;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-extrabold: 800;
  --weight-black: 900;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;

  /* Z-Index */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
}

/* ==================== Global Reset ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ==================== Typography ==================== */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--weight-bold);
  line-height: 1.2;
  color: var(--text-primary);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-md); }

p {
  font-size: var(--text-base);
  color: var(--text-secondary);
}

a {
  color: var(--primary-cyan);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-cyan-hover);
}

/* ==================== Buttons ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
}

.btn-primary {
  background: var(--primary-cyan);
  color: var(--bg-dark);
}

.btn-primary:hover {
  background: var(--primary-cyan-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-cyan);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
}

.btn-outline {
  background: transparent;
  color: var(--primary-cyan);
  border: 1px solid var(--border-cyan);
}

.btn-outline:hover {
  background: var(--success-bg);
}

.btn-sm {
  padding: 8px 16px;
  font-size: var(--text-sm);
}

.btn-lg {
  padding: 16px 32px;
  font-size: var(--text-lg);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ==================== Cards ==================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  transition: all var(--transition-base);
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-md);
}

.card-title {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
}

.card-body {
  font-size: var(--text-base);
  color: var(--text-secondary);
}

/* ==================== Forms ==================== */
.form-group {
  margin-bottom: var(--spacing-md);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  margin-bottom: var(--spacing-sm);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-base);
  font-family: inherit;
  transition: all var(--transition-base);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary-cyan);
  background: rgba(0, 229, 204, 0.05);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

/* ==================== Badges ==================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
}

.badge-error {
  background: var(--error-bg);
  color: var(--error);
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge-pending {
  background: var(--pending-bg);
  color: var(--pending);
}

/* ==================== Progress Bars ==================== */
.progress {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--primary-cyan);
  transition: width var(--transition-slow);
}

/* ==================== Tables ==================== */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.table th {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table td {
  font-size: var(--text-base);
  color: var(--text-primary);
}

.table tr:hover {
  background: var(--bg-card-hover);
}

/* ==================== Utilities ==================== */
.text-positive { color: var(--positive); }
.text-negative { color: var(--negative); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-bold { font-weight: var(--weight-bold); }
.text-semibold { font-weight: var(--weight-semibold); }

.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }

.w-full { width: 100%; }
.h-full { height: 100%; }

.cursor-pointer { cursor: pointer; }

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
  :root {
    --text-4xl: 36px;
    --text-3xl: 28px;
    --text-2xl: 22px;
  }

  .card {
    padding: var(--spacing-md);
  }

  .btn {
    padding: 10px 20px;
  }
}

@media (max-width: 480px) {
  :root {
    --text-4xl: 28px;
    --text-3xl: 24px;
    --text-2xl: 20px;
  }
}
