@layer base, components, utilities;

@layer base {
  :root {
    /* Colors */
    --primary: #2563eb;
    --primary-light: #dbeafe;
    --secondary: #10b981;
    --accent: #f59e0b;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    /* Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-full: 9999px;
  }

  * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }

  body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
  }
}

@layer components {
  .app-container {
    display: grid;
    grid-template-columns: 260px 1fr 320px;
    height: 100vh;
    overflow: hidden;
  }

  /* Sidebar */
  .sidebar {
    background-color: var(--surface);
    border-right: 1px solid var(--border);
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
  }

  /* Main Content */
  .main-content {
    padding: var(--space-xl);
    overflow-y: auto;
    background-color: var(--background);
  }

  /* AI Assistant Panel */
  .ai-panel {
    background-color: var(--surface);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
  }

  /* Cards */
  .card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
  }

  .card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
  }

  /* Buttons */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 0.875rem;
  }

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

  .btn-primary:hover {
    background-color: #1d4ed8;
  }
}

@media (max-width: 1024px) {
  .app-container {
    grid-template-columns: 80px 1fr;
  }
  .ai-panel {
    display: none;
  }
}

@media (max-width: 640px) {
  .app-container {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
}
