@import "tailwindcss";

/* Custom Design Tokens for ADGM Coworking */
:root {
  /* Brand Colors - Black, White & Red Theme */
  --color-brand-primary: #000000; /* Black - sophistication, elegance */
  --color-brand-secondary: #1f1f1f; /* Dark gray - depth */
  --color-brand-accent: #dc2626; /* Red - energy, passion */
  --color-brand-dark: #000000; /* Pure black */
  --color-brand-light: #f9fafb; /* Off-white - cleanliness, space */
  
  /* Extended Color Palette */
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
  --color-info: #3b82f6;
  
  /* Shadows - Depth Hierarchy */
  --shadow-custom-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-custom-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-custom-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --shadow-custom-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
  
  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-2xl: 1rem;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 150ms;
  --transition-base: 200ms;
  --transition-slow: 300ms;
}

/* Custom Utility Classes */
@layer utilities {
  /* Container Utilities */
  .container-narrow {
    max-width: 768px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .container-wide {
    max-width: 1536px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  /* Responsive Text */
  .text-responsive-sm {
    font-size: 0.875rem;
  }
  
  @media (min-width: 768px) {
    .text-responsive-sm {
      font-size: 1rem;
    }
  }
  
  .text-responsive-base {
    font-size: 1rem;
  }
  
  @media (min-width: 768px) {
    .text-responsive-base {
      font-size: 1.125rem;
    }
  }
  
  .text-responsive-lg {
    font-size: 1.125rem;
  }
  
  @media (min-width: 768px) {
    .text-responsive-lg {
      font-size: 1.25rem;
    }
  }
  
  @media (min-width: 1024px) {
    .text-responsive-lg {
      font-size: 1.5rem;
    }
  }
  
  /* Psychological Design Utilities */
  .cta-primary {
    font-family: 'Poppins', sans-serif;
    background-color: var(--color-brand-primary);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-custom-md);
  }
  
  .cta-primary:hover {
    background-color: #1e40af;
    box-shadow: var(--shadow-custom-lg);
    transform: translateY(-2px);
  }
  
  .cta-secondary {
    font-family: 'Poppins', sans-serif;
    background-color: white;
    color: var(--color-brand-primary);
    padding: 0.75rem 2rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    border: 2px solid var(--color-brand-primary);
    transition: all var(--transition-base);
  }
  
  .cta-secondary:hover {
    background-color: var(--color-brand-light);
  }
  
  /* Card Styles */
  .card {
    background-color: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-custom-md);
    padding: 1.5rem;
    transition: all var(--transition-base);
  }
  
  .card:hover {
    box-shadow: var(--shadow-custom-lg);
    transform: translateY(-4px);
  }
  
  /* Mobile Menu Animation */
  .mobile-menu-enter {
    animation: slideDown var(--transition-base) ease-out;
  }
  
  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  /* Testimonial Carousel Animation */
  .animate-fade-in {
    animation: fadeIn 0.5s ease-in;
  }
  
  @keyframes fadeIn {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }
  
  /* Pulse Animation for Scarcity Elements */
  @keyframes pulse {
    0%, 100% {
      opacity: 1;
    }
    50% {
      opacity: 0.7;
    }
  }
  
  .animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  }
}

/* Typography System - Three Fonts */
/* Primary Font: Inter - Body text, paragraphs, general content */
/* Secondary Font: Poppins - Headings, titles, navigation */
/* Accent Font: Playfair Display - Special elements, quotes, featured text */

* {
  min-width: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Secondary Font - Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  line-height: 1.2;
}

h1 {
  font-weight: 800;
}

/* Accent Font - Special Elements */
.font-accent {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
}

blockquote {
  font-family: 'Playfair Display', serif;
  font-style: italic;
}

/* Navigation uses secondary font */
nav a, nav button {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
}

@media (min-width: 768px) {
  body {
    font-size: 18px;
  }
}

/* Ensure proper text wrapping - CRITICAL FIX */
h1, h2, h3, h4, h5, h6, p, div, span, a, li, td, th, article, section, header, footer {
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  word-break: normal !important;
  white-space: normal !important;
  min-width: 0 !important;
}

/* Prevent flex/grid items from forcing narrow widths */
.text-center,
.text-left,
.text-right,
[class*="text-"] {
  min-width: 0 !important;
}

.text-center > *,
.text-left > *,
.text-right > * {
  min-width: 0 !important;
  width: auto !important;
}

/* Fix for centered content */
.mx-auto {
  min-width: 0 !important;
}

/* Ensure containers don't collapse */
.container,
[class*="max-w-"],
[class*="min-w-"] {
  min-width: 0 !important;
}

/* Ensure images are responsive by default */
img {
  max-width: 100%;
  height: auto;
}

/* Blog content prose styling - prevent text overflow */
.prose {
  max-width: 100% !important;
  overflow-wrap: break-word !important;
  word-wrap: break-word !important;
  word-break: break-word !important;
  color: #374151;
  line-height: 1.75;
}

.prose * {
  max-width: 100% !important;
  overflow-wrap: break-word !important;
  word-wrap: break-word !important;
}

/* Headings */
.prose h1 {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.2;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: #111827;
}

.prose h2 {
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: #111827;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 0.5rem;
}

.prose h3 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.4;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: #1f2937;
}

.prose h4 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.5;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: #1f2937;
}

.prose h5 {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.5;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: #374151;
}

.prose h6 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  color: #374151;
}

/* Paragraphs */
.prose p {
  margin-top: 1.25rem;
  margin-bottom: 1.25rem;
  font-size: 1.125rem;
  line-height: 1.75;
  color: #374151;
}

/* Lists */
.prose ul {
  list-style-type: disc;
  margin-top: 1.25rem;
  margin-bottom: 1.25rem;
  padding-left: 1.625rem;
}

.prose ol {
  list-style-type: decimal;
  margin-top: 1.25rem;
  margin-bottom: 1.25rem;
  padding-left: 1.625rem;
}

.prose li {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 1.125rem;
  line-height: 1.75;
  color: #374151;
}

.prose li p {
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
}

.prose ul ul,
.prose ul ol,
.prose ol ul,
.prose ol ol {
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
}

/* Links */
.prose a {
  color: #dc2626;
  text-decoration: underline;
  font-weight: 500;
  transition: color 0.2s;
}

.prose a:hover {
  color: #b91c1c;
}

/* Strong and emphasis */
.prose strong {
  font-weight: 700;
  color: #111827;
}

.prose em {
  font-style: italic;
}

/* Blockquotes */
.prose blockquote {
  border-left: 4px solid #dc2626;
  padding-left: 1.5rem;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  font-style: italic;
  color: #4b5563;
  background-color: #f9fafb;
  padding: 1rem 1.5rem;
  border-radius: 0.375rem;
}

/* Code */
.prose code {
  background-color: #f3f4f6;
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.875em;
  font-family: 'Courier New', monospace;
  color: #dc2626;
  word-break: break-all !important;
}

.prose pre {
  background-color: #1f2937;
  color: #f9fafb;
  padding: 1.25rem;
  border-radius: 0.5rem;
  overflow-x: auto !important;
  white-space: pre-wrap !important;
  word-wrap: break-word !important;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.prose pre code {
  background-color: transparent;
  padding: 0;
  color: inherit;
  font-size: 0.875rem;
}

/* Tables */
.prose table {
  width: 100%;
  margin-top: 2rem;
  margin-bottom: 2rem;
  border-collapse: collapse;
  display: block !important;
  overflow-x: auto !important;
}

.prose thead {
  border-bottom: 2px solid #e5e7eb;
}

.prose th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: #111827;
  background-color: #f9fafb;
}

.prose td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  color: #374151;
}

.prose tbody tr:hover {
  background-color: #f9fafb;
}

/* Horizontal rule */
.prose hr {
  border: 0;
  border-top: 2px solid #e5e7eb;
  margin-top: 3rem;
  margin-bottom: 3rem;
}

/* Images */
.prose img {
  margin-top: 2rem;
  margin-bottom: 2rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* First paragraph after heading */
.prose h2 + p,
.prose h3 + p,
.prose h4 + p {
  margin-top: 0.75rem;
}

/* Trix editor content */
trix-editor {
  overflow-wrap: break-word !important;
  word-wrap: break-word !important;
}

trix-editor * {
  max-width: 100% !important;
}
