/* === RESET & BASE === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-primary: #0077b6;
  --color-primary-dark: #005f8a;
  --color-primary-light: #90e0ef;
  --color-accent: #00b4d8;
  --color-bg: #f0f8ff;
  --color-surface: #ffffff;
  --color-text: #1a1a2e;
  --color-text-light: #555;
  --color-success: #2ecc71;
  --color-warning: #f39c12;
  --color-danger: #e74c3c;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 24px rgba(0, 0, 0, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
  --max-width: 960px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a:hover {
  color: var(--color-accent);
}

img {
  max-width: 100%;
  height: auto;
}

/* === HEADER === */
.header {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
  color: white;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.header__logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header__logo:hover {
  color: white;
}

.header__logo-icon {
  font-size: 1.8rem;
}

.nav {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.nav__link {
  color: rgba(255, 255, 255, 0.9);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  transition: background var(--transition), color var(--transition);
}

.nav__link:hover,
.nav__link--active {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

/* === HAMBURGER === */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.hamburger span {
  display: block;
  width: 26px;
  height: 3px;
  background: white;
  border-radius: 2px;
  transition: var(--transition);
}

/* === MAIN === */
.main {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1rem;
  width: 100%;
}

/* === HOME PAGE === */
.hero {
  text-align: center;
  padding: 2rem 0 3rem;
}

.hero__title {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: 1rem;
}

.hero__subtitle {
  font-size: 1.2rem;
  color: var(--color-text-light);
  max-width: 600px;
  margin: 0 auto;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.tool-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.tool-card__icon {
  font-size: 2.5rem;
  margin-bottom: 0.25rem;
}

.tool-card__title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
}

.tool-card__desc {
  font-size: 0.9rem;
  color: var(--color-text-light);
  flex: 1;
}

.tool-card__link {
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.tool-card__link:hover {
  color: var(--color-accent);
}

/* === TOOL PAGE === */
.tool-page {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.tool-page__header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--color-bg);
}

.tool-page__back {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.tool-page__title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-primary);
}

.tool-page__desc {
  color: var(--color-text-light);
  margin-top: 0.5rem;
}

/* === FORMS === */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 500;
  color: var(--color-text);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #e0e0e0;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: border-color var(--transition);
  background: var(--color-surface);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}

.btn:hover {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
}

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

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

.btn--success:hover {
  background: #27ae60;
}

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

.btn--warning:hover {
  background: #e67e22;
}

.btn--full {
  width: 100%;
}

/* === RESULTS === */
.result {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--color-primary);
}

.result__value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
}

.result__label {
  color: var(--color-text-light);
  font-size: 0.95rem;
}

.result--success {
  border-left-color: var(--color-success);
}

.result--warning {
  border-left-color: var(--color-warning);
}

.result--danger {
  border-left-color: var(--color-danger);
}

/* === CHECKLIST === */
.checklist {
  list-style: none;
}

.checklist__item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  transition: background var(--transition);
}

.checklist__item:hover {
  background: #e6f2ff;
}

.checklist__item input[type="checkbox"] {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.checklist__item.checked {
  opacity: 0.6;
  text-decoration: line-through;
}

/* === TRACKER === */
.tracker__progress {
  margin: 1.5rem 0;
}

.tracker__bar {
  height: 24px;
  background: #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
}

.tracker__bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary-light), var(--color-primary));
  border-radius: 12px;
  transition: width 0.4s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
}

.tracker__glasses {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.tracker__glass {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  border: 2px solid transparent;
}

.tracker__glass:hover {
  transform: scale(1.1);
}

.tracker__glass--filled {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
}

/* === MAP === */
.map-container {
  height: 400px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-top: 1rem;
}

/* === FOOTER === */
.footer {
  background: var(--color-text);
  color: rgba(255, 255, 255, 0.7);
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.9rem;
}

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

/* === TABLE === */
.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.table th,
.table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
}

.table th {
  background: var(--color-bg);
  font-weight: 600;
}

/* === BADGE === */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.badge--good {
  background: #d4edda;
  color: #155724;
}

.badge--warn {
  background: #fff3cd;
  color: #856404;
}

.badge--bad {
  background: #f8d7da;
  color: #721c24;
}

/* === INFO BOX === */
.info-box {
  padding: 1rem 1.25rem;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  margin: 1rem 0;
  border-left: 4px solid var(--color-accent);
}

.info-box p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-text-light);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .nav {
    display: none;
    width: 100%;
    flex-direction: column;
    padding-top: 0.5rem;
  }

  .nav--open {
    display: flex;
  }

  .nav__link {
    padding: 0.6rem 1rem;
  }

  .hero__title {
    font-size: 1.8rem;
  }

  .hero__subtitle {
    font-size: 1rem;
  }

  .tools-grid {
    grid-template-columns: 1fr;
  }

  .tool-page {
    padding: 1.25rem;
  }

  .tool-page__title {
    font-size: 1.4rem;
  }
}

@media (max-width: 480px) {
  .header__inner {
    flex-direction: row;
  }

  .tool-page {
    padding: 1rem;
  }

  .result__value {
    font-size: 1.5rem;
  }
}

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

.fade-in {
  animation: fadeIn 0.4s ease;
}

/* === PRINT === */
@media print {
  .header, .footer, .nav, .hamburger {
    display: none !important;
  }
  .main {
    max-width: 100%;
  }
  .tool-page {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}