/* File: /assets/css/proportion-calculator.css */

/* ------------------------------
   Global / Base Styles
------------------------------ */

@view-transition {
  navigation: auto;
}

html {
  scroll-behavior: smooth;
  height: 100%;
}

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

body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100%;
}

/* Anchor defaults */
a {
  color: #4f46e5;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ------------------------------
   Header & Navigation
------------------------------ */

.header {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(5, 150, 105, 0.2);
}

/* Logo & site name */

.main-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: contain;
}

.site-name {
  color: #ffffff;
  font-weight: 700;
  font-size: 18px;
  white-space: nowrap;
  text-decoration: none;
}

/* Desktop navigation links */

.desktop-main-nav a.nav-link {
  color: #e5f3ff;
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  position: relative;
  padding-bottom: 2px;
  transition: color 0.25s ease;
}

.desktop-main-nav a.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 0;
  height: 2px;
  background: #ffffff;
  transition: width 0.25s ease;
}

.desktop-main-nav a.nav-link:hover {
  color: #ffffff;
}

.desktop-main-nav a.nav-link:hover::after {
  width: 100%;
}

/* Dropdown (More) */

.desktop-more-nav {
  margin-left: 1rem;
}

.dropdown {
  position: relative;
}

.dropdown-toggle {
  background: rgba(16, 185, 129, 0.18);
  border-radius: 999px;
  border: 1px solid rgba(209, 250, 229, 0.4);
  padding: 8px 16px;
  color: #ecfdf5;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.25s ease, transform 0.1s ease;
}

.dropdown-toggle:hover {
  background: rgba(16, 185, 129, 0.32);
  transform: translateY(-1px);
}

/* Desktop dropdown menu */

.dropdown-content {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #ffffff;
  min-width: 230px;
  box-shadow: 0 10px 35px rgba(15, 23, 42, 0.2);
  border-radius: 16px;
  overflow: hidden;
  animation: fadeInDown 0.25s ease;
  z-index: 1100;
}

.dropdown.open .dropdown-content,
.dropdown:hover .dropdown-content {
  display: block;
}

.dropdown-content a {
  color: #4a5568;
  padding: 12px 18px;
  text-decoration: none;
  display: block;
  font-size: 14px;
  transition: background 0.2s ease, padding-left 0.2s ease, color 0.2s ease;
}

.dropdown-content a:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff;
  padding-left: 26px;
}

/* Mobile menu button (hamburger) */

.mobile-menu-btn {
  display: none; /* shown via media query on small screens */
  background: none;
  border: none;
  color: #ffffff;
  font-size: 26px;
  cursor: pointer;
}

/* Slide-down mobile menu */

.mobile-menu {
  position: fixed;
  top: 64px; /* below header */
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  max-height: 0;
  overflow: hidden;
  z-index: 900;
  transition: max-height 0.3s ease;
}

.mobile-menu.open {
  max-height: 420px;
}

.mobile-menu-inner ul {
  list-style: none;
  margin: 0;
  padding: 8px 0 16px;
}

.mobile-menu-inner li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.mobile-menu-inner li:last-child {
  border-bottom: none;
}

.mobile-menu-inner a {
  display: block;
  width: 100%;
  padding: 12px 20px;
  color: #f9fafb;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: background 0.2s ease, padding-left 0.2s ease;
}

.mobile-menu-inner a:hover {
  background: rgba(16, 185, 129, 0.25);
  padding-left: 26px;
}

/* Animations */

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

/* ------------------------------
   Page Header (Hero)
------------------------------ */

.page-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  padding: 80px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120"><path d="M0,0 Q300,60 600,30 T1200,0 L1200,120 L0,120 Z" fill="rgba(255,255,255,0.05)"/></svg>')
    repeat-x bottom;
  background-size: 1200px 120px;
  opacity: 0.3;
}

.page-header h1 {
  font-size: 56px;
  font-weight: 900;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
  text-shadow: 2px 2px 4px rgba(15, 23, 42, 0.35);
  animation: slideInDown 0.5s ease;
}

.page-header p {
  font-size: 22px;
  opacity: 0.95;
  position: relative;
  z-index: 1;
  animation: slideInUp 0.5s ease;
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* ------------------------------
   Calculator Card & Layout
------------------------------ */

.calculator-container {
  max-width: 1200px;
  margin: -60px auto 60px;
  padding: 0 20px;
  position: relative;
  z-index: 10;
}

.calculator-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.3);
  animation: slideUp 0.5s ease;
}

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

.intro-text {
  font-size: 16px;
  line-height: 1.8;
  color: #4a5568;
  margin-bottom: 28px;
}

.intro-text strong {
  color: #4f46e5;
}

/* Proportion display row */

.proportion-display {
  background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
  border-radius: 16px;
  padding: 40px;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  border: 2px solid #e2e8f0;
}

.proportion-input-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.proportion-label {
  font-size: 14px;
  font-weight: 600;
  color: #667eea;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.proportion-input {
  width: 100px;
  padding: 15px;
  border: 2px solid #cbd5e0;
  border-radius: 12px;
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  transition: all 0.25s ease;
  font-family: 'Inter', sans-serif;
  background: #ffffff;
}

.proportion-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
  transform: scale(1.05);
}

.proportion-input:disabled {
  background: #f7fafc;
  color: #667eea;
  border-color: #667eea;
  cursor: not-allowed;
}

.proportion-symbol {
  font-size: 32px;
  font-weight: 700;
  color: #667eea;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* Mode selector buttons */

.mode-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.mode-option {
  padding: 14px 10px;
  background: #f7fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: center;
  font-weight: 600;
  color: #4a5568;
  font-size: 14px;
}

.mode-option:hover {
  background: #edf2f7;
  border-color: #cbd5e0;
  transform: translateY(-2px);
}

.mode-option.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  border-color: #667eea;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
}

.mode-icon {
  font-size: 22px;
  display: block;
  margin-bottom: 6px;
}

/* Calculate button */

.calculate-btn {
  width: 100%;
  padding: 18px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.calculate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.55);
}

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

/* ------------------------------
   Results Section
------------------------------ */

.results-section {
  margin-top: 28px;
  padding: 28px;
  background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
  border-radius: 16px;
  border-left: 4px solid #667eea;
  display: none;
  animation: fadeIn 0.4s ease;
}

.results-section.show {
  display: block;
}

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

.result-title {
  font-size: 22px;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.result-box {
  background: #ffffff;
  padding: 22px;
  border-radius: 12px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.result-label {
  font-weight: 600;
  color: #4a5568;
  font-size: 14px;
  margin-bottom: 6px;
}

.result-value {
  font-weight: 700;
  color: #4f46e5;
  font-size: 18px;
}

/* Step-by-step area */

.step-by-step {
  background: #111827;
  color: #e5e7eb;
  padding: 18px;
  border-radius: 12px;
  font-family: 'Courier New', monospace;
  margin-top: 12px;
  line-height: 1.8;
  font-size: 14px;
}

.step-by-step .step {
  margin-bottom: 10px;
  padding-left: 20px;
  position: relative;
}

.step-by-step .step::before {
  content: '→';
  position: absolute;
  left: 0;
  color: #60a5fa;
  font-weight: bold;
}

/* Download buttons */

.download-buttons {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.download-btn {
  flex: 1;
  padding: 12px 20px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* ------------------------------
   Info Cards (features row)
------------------------------ */

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 36px;
}

.info-card {
  background: #ffffff;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.15);
  transition: all 0.25s ease;
  border-left: 4px solid #667eea;
}

.info-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(102, 126, 234, 0.35);
}

.info-card h3 {
  font-size: 18px;
  font-weight: 700;
  color: #1f2933;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-card p {
  color: #4a5568;
  line-height: 1.7;
  font-size: 14px;
}

/* ------------------------------
   Blog / Content Section
------------------------------ */

.blog-section {
  max-width: 900px;
  margin: 80px auto;
  padding: 0 20px;
}

.blog-content {
  background: #ffffff;
  border-radius: 24px;
  padding: 52px;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.25);
  line-height: 1.9;
}

.blog-content h2 {
  font-size: 40px;
  font-weight: 900;
  color: #1a202c;
  margin-bottom: 28px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.blog-content h3 {
  font-size: 26px;
  font-weight: 700;
  color: #2d3748;
  margin-top: 34px;
  margin-bottom: 18px;
}

.blog-content h4 {
  font-size: 20px;
  font-weight: 600;
  color: #4a5568;
  margin-top: 26px;
  margin-bottom: 12px;
}

.blog-content p {
  color: #4a5568;
  font-size: 16px;
  margin-bottom: 22px;
}

.blog-content ul,
.blog-content ol {
  color: #4a5568;
  margin-left: 28px;
  margin-bottom: 22px;
  padding-left: 0;
}

.blog-content li {
  margin-bottom: 10px;
  line-height: 1.8;
}

.blog-content strong {
  color: #4f46e5;
  font-weight: 700;
}

.highlight-box {
  background: linear-gradient(135deg, #f3f4ff 0%, #f8f5ff 100%);
  padding: 22px;
  border-radius: 12px;
  border-left: 4px solid #667eea;
  margin: 28px 0;
}

.formula-box {
  background: #111827;
  color: #e5e7eb;
  padding: 18px;
  border-radius: 12px;
  font-family: 'Courier New', monospace;
  margin: 20px 0;
  overflow-x: auto;
  line-height: 1.6;
}

/* FAQ */

.faq-container {
  margin-top: 16px;
}

.faq-item {
  border-bottom: 1px solid #e2e8f0;
  padding: 14px 0;
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-question {
  font-size: 17px;
  font-weight: 600;
  color: #2d3748;
  margin: 0 0 6px;
}

.faq-answer {
  margin: 0;
  color: #4a5568;
  font-size: 15px;
}

/* ------------------------------
   Footer
------------------------------ */

.footer {
  background: linear-gradient(135deg, #111827 0%, #020617 100%);
  color: #ffffff;
  padding: 60px 0 20px;
  margin-top: 80px;
}

.footer-column h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.footer-column p {
  font-size: 14px;
  color: #d1d5db;
}

.footer-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-column ul li {
  margin-bottom: 10px;
}

.footer-column ul li a {
  color: #e5e7eb;
  text-decoration: none;
  transition: color 0.25s ease, transform 0.2s ease;
  display: inline-block;
  font-size: 14px;
}

.footer-column ul li a:hover {
  color: #818cf8;
  transform: translateX(4px);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: 32px;
  padding-top: 24px;
  text-align: center;
  color: #9ca3af;
  font-size: 13px;
}

/* ------------------------------
   Responsive Styles
------------------------------ */

@media (max-width: 1024px) {
  .page-header h1 {
    font-size: 44px;
  }

  .page-header p {
    font-size: 20px;
  }
}

@media (max-width: 768px) {
  /* Show hamburger */
  .mobile-menu-btn {
    display: block;
  }

  /* Hide ALL desktop navigation blocks on mobile */
  .desktop-main-nav,
  .desktop-more-nav,
  .nav-links {
    display: none !important;
  }

  .page-header {
    padding: 60px 16px;
  }

  .page-header h1 {
    font-size: 34px;
  }

  .page-header p {
    font-size: 18px;
  }

  .calculator-card {
    padding: 24px;
  }

  .mode-selector {
    grid-template-columns: repeat(2, 1fr);
  }

  .proportion-display {
    padding: 24px;
  }

  .proportion-input {
    width: 80px;
    font-size: 20px;
  }

  .download-buttons {
    flex-direction: column;
  }

  .blog-content {
    padding: 32px 22px;
  }

  .blog-content h2 {
    font-size: 30px;
  }

  .blog-content h3 {
    font-size: 22px;
  }
}

@media (max-width: 480px) {
  .page-header h1 {
    font-size: 28px;
  }

  .site-name {
    font-size: 16px;
  }

  .blog-content {
    padding: 24px 16px;
  }
}
