:root {
  --bg: #0f172a;
  --text: #111827;
  --muted: #4b5563;
  --primary: #2563eb;
  --light: #f8fafc;
  --card: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background: #fff;
  line-height: 1.6;
  /* Fix for iOS Safari */
  -webkit-overflow-scrolling: touch;
}

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid #e5e7eb;
  backdrop-filter: blur(6px);
  z-index: 10;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 0;
}

.logo {
  font-size: clamp(1.05rem, 2vw, 1.8rem);
  margin: 0;
  line-height: 1;
}

.logo-new {
  color: #ef0000;
  font-weight: 800;
}

.logo-rest {
  color: #000;
  font-weight: 800;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 1rem;
  font-weight: 600;
}

nav a:hover {
  color: var(--primary);
}

.hero {
  background: linear-gradient(120deg, #eff6ff, #dbeafe);
  padding: 5rem 0;
  text-align: center;
}

.hero h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.hero p {
  color: var(--muted);
  margin: 0.8rem 0 1.5rem;
}

.btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.75rem 1.2rem;
  border-radius: 0.5rem;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}

.btn:hover {
  filter: brightness(1.06);
}

.section {
  padding: 3.2rem 0;
}

.alt {
  background: var(--light);
}

.cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card {
  background: var(--card);
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1rem;
}

.contact-form {
  display: grid;
  gap: 0.9rem;
  max-width: 580px;
}

label {
  display: grid;
  gap: 0.3rem;
  font-weight: 600;
}

input,
textarea {
  border: 1px solid #d1d5db;
  border-radius: 0.45rem;
  padding: 0.65rem;
  font: inherit;
}

.form-message {
  margin-top: 0.8rem;
  font-weight: 600;
  color: #065f46;
}

footer {
  background: var(--bg);
  color: #cbd5e1;
  padding: 1.2rem 0;
  text-align: center;
}

.schedule-block {
  margin-top: 1.5rem;
}

.schedule-block h4 {
  margin: 0 0 0.7rem;
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.6rem;
  overflow: hidden;
  table-layout: fixed;
}

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

.schedule-table th:first-child,
.schedule-table td:first-child {
  width: 140px;
}

.schedule-table th:nth-child(2),
.schedule-table td:nth-child(2) {
  width: 200px;
}

.schedule-table th:nth-child(3),
.schedule-table td:nth-child(3) {
  width: auto;
}

.schedule-table th {
  background: #f3f4f6;
  font-weight: 700;
}

.schedule-table tr:last-child td {
  border-bottom: none;
}

.org-link {
  color: #1d4ed8;
  font-weight: 600;
  text-decoration: none;
}

.org-link:hover {
  text-decoration: underline;
}

.org-page {
  max-width: 900px;
}

.org-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e5e7eb;
}

.org-header h1 {
  font-size: 3rem;
  margin: 0;
}

.org-logo-placeholder {
    /*    background: #f3f4f6; */
    /*    border: 2px dashed #d1d5db; */
    padding: 2rem 3rem;
    border-radius: 0.5rem;
    /*    color: var(--muted); */
    font-style: italic;
    text-align: center;
}

.org-logo {
    max-width: 300px;
    max-height: 150px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.org-logo-placeholder a {
    display: inline-block;
    text-decoration: none;
}

.org-logo-placeholder a:hover .org-logo {
    opacity: 0.8;
    transform: scale(1.02);
}

/* Multi-logo support */
.org-logo-group {
  display: flex;
  gap: 2rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.org-logo-multi {
  width: 200px;
  height: 120px;
  object-fit: contain;
}

@media (max-width: 700px) {
  .org-logo-group {
    gap: 1rem;
  }

  .org-logo-multi {
    width: 150px;
    height: 100px;
    object-fit: contain;
  }
}

.org-section {
  margin-bottom: 2rem;
}

.org-section h2 {
  font-size: 1.3rem;
  margin: 0 0 0.5rem;
  font-weight: 700;
}

.org-section p {
  margin: 0.5rem 0;
}

.org-links {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

.org-links p {
  margin: 0.5rem 0;
}

@media (max-width: 700px) {
  .nav {
    flex-direction: column;
    gap: 0.7rem;
  }

  nav a {
    margin: 0 0.5rem;
  }

  .schedule-block h4 {
    font-size: 0.95rem;
    line-height: 1.4;
  }

  .schedule-table {
    font-size: 0.85rem;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 0.5rem;
  }

  .schedule-table thead {
    display: none;
  }

  .schedule-table tbody {
    display: block;
  }

  .schedule-table tr {
    display: block;
    margin-bottom: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.75rem;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }

  .schedule-table td {
    display: block;
    padding: 0.4rem 0;
    border: none !important;
    text-align: left !important;
    width: 100% !important;
  }

  .schedule-table td:first-child {
    font-weight: 700;
    color: #2563eb;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
  }

  .schedule-table td:first-child::before {
    content: "🕐 ";
    font-size: 0.85rem;
  }

  .schedule-table td:nth-child(2) {
    color: #6b7280;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f3f4f6 !important;
  }

  .schedule-table td:nth-child(3) {
    font-weight: 600;
    font-size: 0.95rem;
    color: #111827;
    padding-top: 0.5rem;
  }

  .org-header {
    flex-direction: column;
    gap: 1rem;
  }

  .org-header h1 {
    font-size: 2rem;
  }

  .org-logo-placeholder {
    width: 100%;
    text-align: center;
    padding: 1rem;
  }

  .org-logo {
    max-width: 200px;
    max-height: 100px;
  }
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

.modal-content {
  background-color: #fff;
  margin: 5% auto;
  padding: 0;
  border: none;
  border-radius: 1rem;
  width: min(90%, 700px);
  max-height: 85vh;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  position: relative;
  animation: slideUp 0.4s ease-out;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-close {
  position: absolute;
  right: 1.5rem;
  top: 1.5rem;
  color: #6b7280;
  font-size: 2rem;
  font-weight: 300;
  cursor: pointer;
  z-index: 1;
  transition: all 0.2s ease;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
}

.modal-close:hover,
.modal-close:focus {
  color: #111827;
  background: #f3f4f6;
  transform: rotate(90deg);
}

.modal-title {
  margin: 0;
  padding: 2rem 4rem 1.5rem 2rem;
  font-size: 1.75rem;
  font-weight: 700;
  color: #111827;
  background: linear-gradient(120deg, #eff6ff, #dbeafe);
  border-bottom: 2px solid #e5e7eb;
}

.modal-body {
  padding: 1.5rem;
  line-height: 1.5;
  color: #374151;
  overflow-y: auto;
  flex: 1;
}

.modal-body h3 {
  margin: 1rem 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1f2937;
}

.modal-body h3:first-child {
  margin-top: 0;
}

.modal-body p {
  margin: 0.4rem 0;
}

.modal-body a {
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
}

.modal-body a:hover {
  text-decoration: underline;
}

.modal-info {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.modal-info-item {
  flex: 1;
  min-width: 200px;
}

.modal-info-label {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  margin-bottom: 0.25rem;
}

.modal-info-value {
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
}

.event-clickable {
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  /* Better iOS touch handling */
  -webkit-tap-highlight-color: rgba(37, 99, 235, 0.1);
  touch-action: manipulation;
}

.event-clickable:hover {
  color: #2563eb !important;
  text-decoration: underline;
}

@media (max-width: 700px) {
  .modal-content {
    margin: 10% auto;
    width: 95%;
  }

  .modal-title {
    padding: 1.5rem 3.5rem 1.25rem 1.5rem;
    font-size: 1.5rem;
  }

  .modal-body {
    padding: 1.5rem;
  }

  .modal-info {
    flex-direction: column;
    gap: 1rem;
  }

  .modal-close {
    right: 1rem;
    top: 1rem;
  }
}

/* Website Selector Modal */
.website-selector-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 1rem;
}

.website-selector-modal.active {
  opacity: 1;
}

.website-selector-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 100%;
  position: relative;
  padding: 2rem;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.website-selector-modal.active .website-selector-content {
  transform: scale(1);
}

.website-selector-content h3 {
  margin: 0 0 0.5rem 0;
  color: #e74c3c;
  font-size: 1.5rem;
}

.website-selector-content p {
  margin: 0 0 1.5rem 0;
  color: #666;
}

.website-selector-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  color: #999;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.website-selector-close:hover {
  background: #f0f0f0;
  color: #333;
}

.website-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.website-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: #f8f9fa;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  text-decoration: none;
  color: #333;
  transition: all 0.2s ease;
  cursor: pointer;
}

.website-option:hover {
  background: #e74c3c;
  border-color: #e74c3c;
  color: white;
  transform: translateX(4px);
}

.website-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: white;
  border-radius: 50%;
  font-weight: bold;
  font-size: 0.9rem;
  color: #e74c3c;
  flex-shrink: 0;
}

.website-option:hover .website-number {
  background: white;
  color: #e74c3c;
}

.website-url {
  flex: 1;
  font-size: 1rem;
  font-weight: 500;
}

.website-arrow {
  font-size: 1.25rem;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.website-option:hover .website-arrow {
  opacity: 1;
}

/* Mobile adjustments for website selector */
@media (max-width: 700px) {
  .website-selector-content {
    padding: 1.5rem;
    margin: 1rem;
  }

  .website-selector-content h3 {
    font-size: 1.25rem;
  }

  .website-option {
    padding: 0.875rem;
  }

  .website-url {
    font-size: 0.9rem;
  }
}

/* Print Styles */
@media print {
  /* Balanced compact A4 layout */
  @page {
    size: A4;
    margin: 0.7cm;
  }

  /* Hide navigation and footer */
  header nav,
  footer {
    display: none;
  }

  /* Remove background images and colors */
  body {
    background: white;
    color: black;
    font-size: 8pt;
    line-height: 1.25;
  }

  .hero,
  .section.alt {
    background-image: none;
    background-color: white;
  }

  /* Compact container */
  .container {
    max-width: 100%;
    padding: 0;
    margin: 0;
  }

  /* Balanced headings */
  h1 {
    font-size: 14pt;
    margin: 0.25em 0;
    page-break-after: avoid;
  }

  h2 {
    font-size: 11pt;
    margin: 0.25em 0;
    page-break-after: avoid;
  }

  h3 {
    font-size: 9pt;
    margin: 0.2em 0;
    page-break-after: avoid;
  }

  /* Balanced paragraphs and sections */
  p {
    margin: 0.2em 0;
    font-size: 8pt;
  }

  .section {
    padding: 0.2em 0;
    margin: 0.2em 0;
  }

  .org-section,
  .event-card {
    page-break-inside: avoid;
    padding: 0.25em;
    margin: 0.25em 0;
  }

  /* Show link URLs for external links - balanced */
  a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 6.5pt;
    color: #666;
  }

  /* Don't show URLs for internal navigation links */
  a[href^="#"]:after,
  .org-link:after {
    content: none;
  }

  /* Medium-small logos */
  .org-logo {
    max-width: 85px;
    max-height: 50px;
  }

  .org-logo-multi {
    width: 70px;
    height: 50px;
  }

  /* Optimize table printing - balanced */
  table {
    page-break-inside: auto;
    font-size: 7.5pt;
  }

  tr {
    page-break-inside: avoid;
    page-break-after: auto;
  }

  td, th {
    padding: 0.15em 0.25em;
  }

  /* Timetable styling - balanced */
  .timetable-container {
    overflow: visible;
  }

  .timetable {
    width: 100%;
  }

  /* Remove shadows and effects */
  .btn,
  .org-link,
  .event-card {
    box-shadow: none;
    border: 1px solid #ddd;
    padding: 0.15em 0.35em;
    font-size: 8pt;
  }

  /* Balanced lists */
  ul, ol {
    margin: 0.25em 0;
    padding-left: 1.1em;
  }

  li {
    margin: 0.08em 0;
    font-size: 8pt;
  }

  /* Compact hero section */
  .hero {
    padding: 0.4em 0;
    margin: 0;
  }

  .hero h1 {
    margin: 0.25em 0;
  }

  /* Compact org details */
  .org-details p {
    margin: 0.15em 0;
  }
}

/* Speakers Page Styles */
.speakers-list {
  display: grid;
  gap: 1.5rem;
}

.speaker-entry {
  background: var(--card);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.2s;
}

.speaker-entry:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.speaker-entry h3 {
  margin: 0 0 0.5rem 0;
  color: var(--text);
  font-size: 1.2rem;
}

.speaker-entry .speaker-bio {
  margin: 0.75rem 0;
  color: var(--text);
  font-size: 0.95rem;
  font-style: italic;
  line-height: 1.6;
}

.speaker-entry p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.speaker-entry .org-link {
  display: inline;
  margin-right: 0.3em;
}

.nav-links a.active {
  font-weight: 600;
  color: var(--primary);
}

@media print {
  .speaker-entry {
    page-break-inside: avoid;
    padding: 0.3em;
    margin: 0.2em 0;
    box-shadow: none;
    border: 1px solid #ddd;
  }

  .speaker-entry h3 {
    font-size: 9pt;
    margin: 0.2em 0;
  }

  .speaker-entry p {
    font-size: 8pt;
    margin: 0.1em 0;
  }
}
