:root {
  /* Default Light Mode Colors */
  --primary-color: oklch(0.55 0.18 250); 
  --accent-color: oklch(0.7 0.2 150);   
  --bg-color: oklch(0.98 0.01 250);    
  --surface-color: oklch(1 0 0);       
  --text-primary: oklch(0.25 0.05 250);
  --text-secondary: oklch(0.45 0.04 250);
  --border-color: oklch(0.9 0.02 250);
  --card-bg-sub: oklch(0.97 0.01 250);
  
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  
  --shadow-sm: 0 2px 8px oklch(0 0 0 / 0.05);
  --shadow-md: 0 10px 30px oklch(0 0 0 / 0.08);
  --shadow-lg: 0 20px 60px oklch(0.4 0.1 250 / 0.15);
  
  --font-main: 'Inter', 'Noto Sans KR', sans-serif;
}

/* Dark Mode Colors */
body.dark-mode {
  --bg-color: oklch(0.2 0.02 250);
  --surface-color: oklch(0.25 0.02 250);
  --text-primary: oklch(0.95 0.01 250);
  --text-secondary: oklch(0.75 0.02 250);
  --border-color: oklch(0.35 0.02 250);
  --card-bg-sub: oklch(0.28 0.02 250);
  
  --shadow-sm: 0 2px 8px oklch(0 0 0 / 0.3);
  --shadow-md: 0 10px 30px oklch(0 0 0 / 0.4);
  --shadow-lg: 0 20px 60px oklch(0 0 0 / 0.5);
}

@layer base, components, utilities;

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

  body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.3s, color 0.3s;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.02'/%3E%3C/svg%3E");
  }

  h1, h2, h3 {
    font-weight: 700;
    letter-spacing: -0.02em;
  }

  button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
}

@layer components {
  .app-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1rem 1.5rem 4rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
  }

  /* Header Styles */
  .app-header {
    padding: 1rem 0 3rem;
  }

  .header-nav {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 2rem;
  }

  .nav-btn {
    padding: 0.5rem 1rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
  }

  .nav-btn:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
  }

  .app-header .header-content {
    text-align: center;
  }

  .app-header h1 {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    color: var(--primary-color);
    letter-spacing: -0.05em;
  }

  /* Search Section */
  .search-section {
    container-type: inline-size;
  }

  /* Results Section */
  .results-section {
    min-height: 300px;
  }

  .empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--border-color);
    color: var(--text-secondary);
  }

  .empty-state .icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    opacity: 0.5;
  }

  /* Modern Footer */
  .app-footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
  }
}

/* Custom Elements Styling */
study-search {
  display: block;
  width: 100%;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
