@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100..900&family=Poppins:wght@100;200;300;400;500;600;700;800;900&display=swap');

@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
  /* Default colors - will be overridden by conference configuration */
  --color-primary: #0078d4;
  --color-primary-dark: #005a9e;
  --color-primary-light: #40e0ff;
  --color-secondary: #6c757d;
  --color-secondary-dark: #495057;
  --color-secondary-light: #adb5bd;
  --color-accent: #ffc107;
  --color-background: #ffffff;
  --color-surface: #f8f9fa;
  --color-text: #333333;
  --color-text-light: #6c757d;
  --color-success: #28a745;
  --color-warning: #ffc107;
  --color-error: #dc3545;
  
  /* Button colors - will be overridden by conference configuration */
  --btn-primary-bg: #0078d4;
  --btn-primary-bg-hover: #005a9e;
  --btn-primary-text: #ffffff;
  --btn-primary-border: #0078d4;
  
  --btn-secondary-bg: #ffffff;
  --btn-secondary-bg-hover: #f8f9fa;
  --btn-secondary-text: #0078d4;
  --btn-secondary-border: #0078d4;
  
  --btn-outline-bg: transparent;
  --btn-outline-bg-hover: #f8f9fa;
  --btn-outline-text: #333333;
  --btn-outline-border: #6c757d;
  
  /* Legacy support - these will be removed gradually */
  --primary-color: var(--color-primary);
  --primary-dark-color: var(--color-primary-dark);
  --primary-light-color: var(--color-primary-light);
  --secondary-color: var(--color-secondary);
  --secondary-dark-color: var(--color-secondary-dark);
  --secondary-light-color: var(--color-secondary-light);
  --accent-color: var(--color-accent);
  --accent-dark-color: var(--color-primary-dark);
  --accent-light-color: var(--color-primary-light);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #ffffff;
}

/* Utility classes for smooth animations */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease-out;
}

.animate-on-scroll.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark-color);
}

/* Mobile menu animations and improvements */
.mobile-menu {
  animation-duration: 0.3s;
  animation-timing-function: ease-out;
}

.mobile-menu:not(.hidden) {
  animation-name: slideDown;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Tablet dropdown menu animations */
.tablet-more-menu {
  animation-duration: 0.2s;
  animation-timing-function: ease-out;
}

.tablet-more-menu:not(.hidden) {
  animation-name: fadeInScale;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-5px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Improve mobile menu accessibility and touch targets */
.mobile-menu a {
  min-height: 48px; /* Larger touch target for mobile */
  display: flex;
  align-items: center;
}

/* Better focus states for all menus */
.mobile-menu-button:focus,
.tablet-more-button:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.mobile-menu a:focus,
.tablet-more-menu a:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}

/* Smooth icon transitions */
.mobile-menu-button svg,
.tablet-more-button svg {
  transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
}

/* Prevent body scroll when mobile menu is open */
body.mobile-menu-open {
  overflow: hidden;
}

/* Header improvements */
header {
  transition: box-shadow 0.2s ease-in-out;
}

/* Custom responsive navigation classes */
.desktop-nav {
  display: none;
}

.tablet-nav {
  display: none;
}

.mobile-nav {
  display: block;
}

/* Desktop navigation - show on large screens (1024px+) */
@media (min-width: 1024px) {
  .desktop-nav {
    display: flex !important;
  }
  
  .tablet-nav {
    display: none !important;
  }
  
  .mobile-nav {
    display: none !important;
  }
}

/* Tablet navigation - show on medium screens (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  .desktop-nav {
    display: none !important;
  }
  
  .tablet-nav {
    display: flex !important;
  }
  
  .mobile-nav {
    display: none !important;
  }
}

/* Mobile navigation - show on small screens (below 768px) */
@media (max-width: 767px) {
  .desktop-nav {
    display: none !important;
  }
  
  .tablet-nav {
    display: none !important;
  }
  
  .mobile-nav {
    display: block !important;
  }
}

/* Ensure hidden class works */
.hidden {
  display: none !important;
}

/* Responsive typography and spacing */
@media (max-width: 639px) {
  /* Small mobile devices */
  .mobile-menu {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  }
  
  .mobile-menu-button {
    padding: 12px; /* Larger touch target */
  }
}

@media (min-width: 640px) and (max-width: 767px) {
  /* Large mobile devices / Small tablets */
  .mobile-menu a {
    padding: 16px 12px;
    font-size: 1.1rem;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  /* Tablet devices */
  .tablet-more-menu {
    min-width: 12rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  }
  
  /* Ensure tablet navigation doesn't overflow */
  nav > div {
    gap: 1rem;
  }
}

@media (min-width: 1024px) {
  /* Desktop devices */
  nav {
    padding-left: 2rem;
    padding-right: 2rem;
  }
  
  /* More generous spacing on large screens */
  .lg\\:space-x-8 > * + * {
    margin-left: 2rem;
  }
}

/* Brand name truncation improvements */
.truncate {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

/* Ensure proper z-index layering */
.tablet-more-menu {
  z-index: 60;
}

.mobile-menu {
  z-index: 50;
}

/* Improved hover states for better user feedback */
@media (hover: hover) {
  .tablet-more-button:hover svg {
    transform: rotate(180deg);
  }
}

/* Better button styling for registration CTA */
.bg-primary {
  position: relative;
  overflow: hidden;
}

.bg-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.bg-primary:hover::before {
  left: 100%;
}
