@tailwind base;
@tailwind components;
@tailwind utilities;

/* ===== BASE STYLES ===== */
@layer base {
  html {
    scroll-behavior: smooth;
  }
  
  body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #0D1A2E;
    background-color: #F8F9FA;
  }

  h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
  }
}

/* ===== CUSTOM PROPERTIES ===== */
:root {
  --outrun-primary: #1F56FF;
  --outrun-navy: #0D1A2E;
  --outrun-purple: #8A63FF;
  --outrun-gray: #F3F4F6;
  --outrun-textgray: #6B7280;
  
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-2xl: 4rem;
  
  --border-radius-sm: 0.375rem;
  --border-radius-md: 0.5rem;
  --border-radius-lg: 0.75rem;
  --border-radius-xl: 1rem;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* ===== LAYOUT COMPONENTS ===== */
@layer components {
  .container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
  }
  
  @media (min-width: 640px) {
    .container {
      padding: 0 var(--spacing-md);
    }
  }
  
  @media (min-width: 1024px) {
    .container {
      padding: 0 var(--spacing-lg);
    }
  }

  .section {
    padding: var(--spacing-2xl) 0;
  }
  
  .section-sm {
    padding: var(--spacing-xl) 0;
  }
  
  .section-lg {
    padding: calc(var(--spacing-2xl) * 1.5) 0;
  }
}

/* ===== NAVIGATION ===== */
@layer components {
  .nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 50;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #E2E8F0;
    transition: var(--transition-normal);
  }
  
  .nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4rem;
  }
  
  .nav-brand {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--outrun-primary);
    text-decoration: none;
  }
  
  .nav-menu {
    display: none;
  }
  
  @media (min-width: 768px) {
    .nav-menu {
      display: flex;
      align-items: center;
      gap: 1.5rem;
    }
  }
  
  .nav-link {
    color: var(--outrun-textgray);
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition-fast);
  }
  
  .nav-link:hover {
    color: var(--outrun-primary);
  }
}

/* ===== HERO SECTION ===== */
@layer components {
  .hero {
    background: linear-gradient(135deg, #0A0E27 0%, #1F56FF 25%, #8A63FF 75%, #FF6B6B 100%);
    color: white;
    padding: 6rem 0 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
  }

  .hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 20%, rgba(255, 107, 107, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(138, 99, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
  }

  .hero-logo {
    position: relative;
    z-index: 1;
  }

  .hero-logo-img {
    height: 120px;
    width: auto;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
    animation: float 3s ease-in-out infinite;
  }

  @media (min-width: 768px) {
    .hero-logo-img {
      height: 150px;
    }
  }
  
  .hero-content {
    max-width: 48rem;
    margin: 0 auto;
    position: relative;
    z-index: 1;
  }
  
  .hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
  }
  
  @media (min-width: 768px) {
    .hero-title {
      font-size: 3.75rem;
    }
  }
  
  .hero-subtitle {
    font-size: 1.125rem;
    color: #BFDBFE;
    margin-bottom: 2rem;
  }
  
  @media (min-width: 768px) {
    .hero-subtitle {
      font-size: 1.25rem;
    }
  }
}

/* ===== CARDS ===== */
@layer components {
  .card {
    background: linear-gradient(145deg, #FFFFFF 0%, #F8FAFC 100%);
    border: 1px solid rgba(31, 86, 255, 0.1);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 4px 20px rgba(31, 86, 255, 0.1);
    transition: var(--transition-normal);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: hidden;
  }

  .card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #1F56FF 0%, #8A63FF 50%, #FF6B6B 100%);
    opacity: 0;
    transition: var(--transition-normal);
  }
  
  .card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(31, 86, 255, 0.2);
  }

  .card:hover::before {
    opacity: 1;
  }
  
  .card-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid #E2E8F0;
  }
  
  .card-body {
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    flex-grow: 1;
  }
  
  .card-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid #E2E8F0;
  }
}

/* ===== NEWS SECTION ===== */
@layer components {
  .grid-news {
    display: grid;
    gap: 2rem;
    align-items: stretch;
  }
  
  @media (min-width: 768px) {
    .grid-news {
      grid-template-columns: repeat(2, 1fr);
    }
  }
  
  @media (min-width: 1024px) {
    .grid-news {
      grid-template-columns: repeat(3, 1fr);
    }
  }
  
  .news-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    display: flex;
    flex-direction: column;
    height: 100%;
  }
  
  .news-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
  }
  
  .news-image {
    height: 200px;
    background: linear-gradient(135deg, var(--outrun-gray) 0%, #E5E7EB 100%);
    position: relative;
    overflow: hidden;
  }
  
  .news-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, var(--outrun-primary) 0%, var(--outrun-purple) 100%);
    opacity: 0.1;
    position: relative;
  }
  
  .news-placeholder::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: var(--outrun-primary);
    border-radius: 50%;
    opacity: 0.2;
  }
  
  .news-content {
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    flex-grow: 1;
  }
  
  .news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
    font-size: 0.875rem;
  }
  
  .news-date {
    color: var(--outrun-textgray);
  }
  
  .news-category {
    background: var(--outrun-primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }
  
  .news-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--outrun-navy);
    margin-bottom: var(--spacing-sm);
    line-height: 1.3;
  }
  
  .news-excerpt {
    color: var(--outrun-textgray);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: var(--spacing-md);
  }
  
  .news-link {
    color: var(--outrun-primary);
    font-weight: 500;
    text-decoration: none;
    font-size: 0.875rem;
    transition: var(--transition-fast);
  }
  
  .news-link:hover {
    color: #1a4fd9;
    text-decoration: underline;
  }
}

/* ===== BUTTONS ===== */
@layer components {
  .btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-md);
    font-weight: 500;
    font-size: 1rem;
    text-decoration: none;
    text-align: center;
    transition: var(--transition-normal);
    cursor: pointer;
    border: none;
  }
  
  .btn-primary {
    background: var(--outrun-primary);
    color: white;
  }
  
  .btn-primary:hover {
    background: #1a4fd9;
    transform: translateY(-1px);
  }
  
  .btn-secondary {
    background: transparent;
    border: 1px solid var(--outrun-primary);
    color: var(--outrun-primary);
  }
  
  .btn-secondary:hover {
    background: var(--outrun-primary);
    color: white;
  }

  .btn-hero-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    backdrop-filter: blur(10px);
  }

  .btn-hero-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: white;
  }
  
  .btn-full {
    width: 100%;
  }
}

/* ===== GRIDS ===== */
@layer components {
  .grid-cards {
    display: grid;
    gap: 2rem;
    align-items: stretch;
  }
  
  @media (min-width: 768px) {
    .grid-cards {
      grid-template-columns: repeat(3, 1fr);
    }
  }
  
  .grid-2-cols {
    display: grid;
    gap: 3rem;
  }
  
  @media (min-width: 1024px) {
    .grid-2-cols {
      grid-template-columns: repeat(2, 1fr);
    }
  }
}

/* ===== TEXT UTILITIES ===== */
@layer utilities {
  .text-center { text-align: center; }
  .text-left { text-align: left; }
  .text-right { text-align: right; }
  
  .font-light { font-weight: 300; }
  .font-normal { font-weight: 400; }
  .font-medium { font-weight: 500; }
  .font-semibold { font-weight: 600; }
  .font-bold { font-weight: 700; }
  
  .text-sm { font-size: 0.875rem; }
  .text-base { font-size: 1rem; }
  .text-lg { font-size: 1.125rem; }
  .text-xl { font-size: 1.25rem; }
  .text-2xl { font-size: 1.5rem; }
  .text-3xl { font-size: 1.875rem; }
  .text-4xl { font-size: 2.25rem; }
  .text-5xl { font-size: 3rem; }
}

/* ===== SPACING UTILITIES ===== */
@layer utilities {
  .p-xs { padding: var(--spacing-xs); }
  .p-sm { padding: var(--spacing-sm); }
  .p-md { padding: var(--spacing-md); }
  .p-lg { padding: var(--spacing-lg); }
  .p-xl { padding: var(--spacing-xl); }
  
  .px-sm { padding-left: var(--spacing-sm); padding-right: var(--spacing-sm); }
  .px-md { padding-left: var(--spacing-md); padding-right: var(--spacing-md); }
  .px-lg { padding-left: var(--spacing-lg); padding-right: var(--spacing-lg); }
  
  .py-sm { padding-top: var(--spacing-sm); padding-bottom: var(--spacing-sm); }
  .py-md { padding-top: var(--spacing-md); padding-bottom: var(--spacing-md); }
  .py-lg { padding-top: var(--spacing-lg); padding-bottom: var(--spacing-lg); }
  .py-xl { padding-top: var(--spacing-xl); padding-bottom: var(--spacing-xl); }
  
  .m-xs { margin: var(--spacing-xs); }
  .m-sm { margin: var(--spacing-sm); }
  .m-md { margin: var(--spacing-md); }
  .m-lg { margin: var(--spacing-lg); }
  .m-xl { margin: var(--spacing-xl); }
  
  .mb-sm { margin-bottom: var(--spacing-sm); }
  .mb-md { margin-bottom: var(--spacing-md); }
  .mb-lg { margin-bottom: var(--spacing-lg); }
  .mb-xl { margin-bottom: var(--spacing-xl); }
  .mb-2xl { margin-bottom: var(--spacing-2xl); }
  
  .mt-sm { margin-top: var(--spacing-sm); }
  .mt-md { margin-top: var(--spacing-md); }
  .mt-lg { margin-top: var(--spacing-lg); }
  .mt-xl { margin-top: var(--spacing-xl); }
}

/* ===== COLOR UTILITIES ===== */
@layer utilities {
  .text-primary { color: var(--outrun-primary); }
  .text-navy { color: var(--outrun-navy); }
  .text-purple { color: var(--outrun-purple); }
  .text-gray { color: var(--outrun-textgray); }
  .text-white { color: white; }
  
  .bg-primary { background-color: var(--outrun-primary); }
  .bg-navy { background-color: var(--outrun-navy); }
  .bg-purple { background-color: var(--outrun-purple); }
  .bg-gray { background-color: var(--outrun-gray); }
  .bg-white { background-color: white; }
  .bg-light-gray { background-color: #F8FAFC; }
}

/* ===== FLEXBOX UTILITIES ===== */
@layer utilities {
  .flex { display: flex; }
  .flex-col { flex-direction: column; }
  .flex-row { flex-direction: row; }
  .items-center { align-items: center; }
  .items-start { align-items: flex-start; }
  .justify-center { justify-content: center; }
  .justify-between { justify-content: space-between; }
  .flex-grow-1 { flex-grow: 1; }
  .gap-sm { gap: var(--spacing-sm); }
  .gap-md { gap: var(--spacing-md); }
  .gap-lg { gap: var(--spacing-lg); }
}

/* ===== RESPONSIVE UTILITIES ===== */
@layer utilities {
  .hidden { display: none; }
  .block { display: block; }
  .inline-block { display: inline-block; }
  
  @media (min-width: 768px) {
    .md\\:block { display: block; }
    .md\\:hidden { display: none; }
    .md\\:flex { display: flex; }
  }
  
  @media (min-width: 1024px) {
    .lg\\:block { display: block; }
    .lg\\:hidden { display: none; }
    .lg\\:flex { display: flex; }
  }
}

/* ===== ANIMATIONS ===== */
@layer utilities {
  .animate-fade-in {
    animation: fadeIn 0.6s ease-out;
  }
  
  .animate-slide-up {
    animation: slideUp 0.8s ease-out;
  }
  
  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  
  @keyframes slideUp {
    from { 
      transform: translateY(30px);
      opacity: 0;
    }
    to { 
      transform: translateY(0);
      opacity: 1;
    }
  }
}

/* ===== ACCESSIBILITY ===== */
@layer utilities {
  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  
  .focus\\:outline-none:focus {
    outline: 2px solid var(--outrun-primary);
    outline-offset: 2px;
  }
}
