:root {
  --font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  
  /* Standard Colors for Maximum Compatibility & Professional Look */
  --bg-color: #f8f9fa;
  --text-main: #1a1c1e;
  --text-muted: #5e6368;
  --primary: #4285f4;
  --primary-glow: #669df6;
  --secondary: #e8f0fe;
  --accent: #e91e63;
  --surface: #ffffff;
  --border: #dadce0;
  --dog-color: #fb8c00;
  --cat-color: #7b1fa2;
  --error: #ea4335;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.12);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  background-image: radial-gradient(circle at 2px 2px, rgba(0, 0, 0, 0.03) 1px, transparent 0);
  background-size: 32px 32px;
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Navigation Bar */
.main-nav {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  height: 70px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
}

.nav-container {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.2rem;
  font-weight: 800;
  text-decoration: none;
  color: var(--text-main);
}

.main-nav nav {
  display: flex;
  gap: 1.5rem;
}

.main-nav nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.main-nav nav a:hover, .main-nav nav a.active {
  color: var(--primary);
}

/* Main Container */
.container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 2rem;
  flex-grow: 1;
}

.card-wrapper {
  background: var(--surface);
  padding: 3rem;
  border-radius: 32px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  margin-bottom: 2.5rem;
}

.main-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: linear-gradient(90deg, var(--dog-color), var(--cat-color));
}

.header {
  margin-bottom: 2.5rem;
  text-align: center;
}

.header h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  letter-spacing: -0.03em;
}

.header p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

.test-area {
  position: relative;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

/* Loading Overlay */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: var(--surface);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Upload Zone */
.upload-zone {
  width: 100%;
  border: 3px dashed var(--border);
  border-radius: 24px;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #fdfdfd;
}

.upload-zone:hover {
  border-color: var(--primary);
  background: #f0f7ff;
}

.upload-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.upload-content p {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.upload-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Image Preview */
.image-preview-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

#face-image {
  width: 100%;
  max-width: 300px;
  height: auto;
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  object-fit: cover;
}

/* Buttons */
.btn-primary, .btn-secondary {
  font-family: inherit;
  font-weight: 700;
  padding: 1rem 2rem;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  font-size: 1.1rem;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 15px rgba(66, 133, 244, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(66, 133, 244, 0.4);
}

.btn-secondary {
  background: var(--secondary);
  color: var(--primary);
  border: 1px solid rgba(66, 133, 244, 0.2);
}

/* Result Section */
.result-container {
  width: 100%;
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.result-header h2 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
}

.result-bars {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.label-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.bar-bg {
  flex-grow: 1;
  height: 12px;
  background: #eee;
  border-radius: 6px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0%;
  transition: width 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-radius: 6px;
}

.dog-color { background: var(--dog-color); }
.cat-color { background: var(--cat-color); }

.result-message {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-muted);
}

/* Informational Sections */
.info-card {
  background: var(--surface);
  padding: 2.5rem;
  border-radius: 24px;
  border: 1px solid var(--border);
  margin-bottom: 2rem;
}

.info-card h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
}

.info-card p {
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.info-box {
  padding: 2rem;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.info-box h3 {
  margin-bottom: 1rem;
}

.dog-theme { background: #fff8f0; border-color: rgba(251, 140, 0, 0.2); }
.cat-theme { background: #fdf0ff; border-color: rgba(123, 31, 162, 0.2); }

/* Policy Card Specific */
.content-text h3 {
  margin: 1.5rem 0 0.8rem;
}

/* Ad Placeholder */
.ad-placeholder {
  margin-bottom: 2.5rem;
  text-align: center;
}

/* Comments Section */
.comments-wrapper {
  background: var(--surface);
  padding: 2.5rem;
  border-radius: 32px;
  border: 1px solid var(--border);
}

/* Footer */
.main-footer {
  background: #f1f3f4;
  padding: 3rem 0;
  border-top: 1px solid var(--border);
}

.footer-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-container p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--primary);
}

.hidden {
  display: none !important;
}

@media (max-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .footer-container {
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
  }
}
