/* References Page Styles - Sadece Masonry Grid Kısmı Değiştirildi */

/* CSS Variables */
:root {
  --primary-color: #1E3A8A;
  --primary-light: #3B82F6;
  --text-dark: #1F2937;
  --text-light: #6B7280;
  --border-radius: 12px;
  --border-radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.25);
}

/* Hero Section */
.references-hero {
  position: relative;
  height: 50vh;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1E3A8A 0%, #1E40AF 100%);
  color: white;
  overflow: hidden;
}

.references-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  opacity: 0.3;
  z-index: 2;
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.6) 0%, rgba(30, 64, 175, 0.4) 100%);
  z-index: 2;
}

.references-hero .container {
  position: relative;
  z-index: 3;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
  animation: fadeInUp 1s ease-out;
  color: white !important;
}

.hero-description {
  font-size: 1.3rem;
  opacity: 0.95;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
  animation: fadeInUp 1s ease-out 0.2s both;
  color: white !important;
  line-height: 1.7;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* Stats Cards */
.stat-card {
  background: white;
  padding: 3rem 2rem;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  border: 1px solid transparent;
  height: 100%;
  text-align: center;
}

.stat-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-15px);
  border-color: var(--primary-color);
}

.stat-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 2rem;
  transition: all 0.3s ease;
}

.stat-icon i {
  font-size: 2rem;
  color: white;
}

.stat-card:hover .stat-icon {
  transform: scale(1.1);
}

.stat-number {
  font-size: 3rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 1rem;
  line-height: 1;
}

.stat-label {
  color: var(--text-dark);
  font-weight: 600;
  font-size: 1.1rem;
  margin: 0;
}

/* Simple Masonry Grid */
.simple-masonry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  align-items: start;
  width: 100%;
  max-width: 100%;
  overflow: visible;
}

/* Reference Cards (scoped properly) */
#referencesGrid .simple-reference-card {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  padding: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid #e2e8f0;
  position: relative;
  display: flex;
  flex-direction: column;     /* Logo + text stacked */
  align-items: center;
  justify-content: flex-start;
  text-align: center
}

#referencesGrid .simple-reference-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

#referencesGrid .simple-reference-card h3 {
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.2;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
}

#referencesGrid .simple-reference-card:hover h3 {
  color: var(--primary-color);
}

#referencesGrid .simple-reference-card img {
  max-width: 100px;
  max-height: 60px;
  object-fit: contain;
  margin-bottom: 0.5rem;
  display: block;
}

/* Success Stories */
.success-story-card {
  background: white;
  padding: 3rem 2rem;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  text-align: center;
  transition: all 0.3s ease;
  height: 100%;
  border: 1px solid transparent;
}

.success-story-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-15px);
  border-color: var(--primary-color);
}

.story-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 2rem;
  color: white;
  font-size: 2rem;
  transition: all 0.3s ease;
}

.success-story-card:hover .story-icon {
  transform: scale(1.1);
}

.success-story-card h4 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-weight: 600;
  font-size: 1.3rem;
}

.success-story-card p {
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 2rem;
}

.story-stats {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.story-stats .stat {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: white;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(30, 58, 138, 0.2);
}

/* Testimonials */
.testimonial-card {
  background: white;
  padding: 2.5rem;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  height: 100%;
  border: 1px solid transparent;
}

.testimonial-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-10px);
  border-color: var(--primary-color);
}

.testimonial-content {
  margin-bottom: 2rem;
  position: relative;
}

.quote-icon {
  color: var(--primary-color);
  font-size: 2rem;
  margin-bottom: 1rem;
}

.testimonial-content p {
  font-style: italic;
  color: var(--text-light);
  line-height: 1.7;
  margin: 0;
  font-size: 1.1rem;
}

.testimonial-author {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.author-info h5 {
  color: var(--primary-color);
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.author-info span {
  color: var(--text-light);
  font-size: 0.9rem;
}

.company-logo {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
}

/* CTA Section */
.cta-section {
  padding: 6rem 0;
  background: linear-gradient(135deg, #1E3A8A 0%, #1E40AF 100%);
  color: white;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="cta-grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23cta-grid)"/></svg>');
  opacity: 0.3;
}

.cta-section .container {
  position: relative;
  z-index: 2;
}

.cta-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: white !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cta-description {
  font-size: 1.2rem;
  margin-bottom: 3rem;
  color: rgba(255, 255, 255, 0.95) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  line-height: 1.6;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.cta-buttons {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.cta-btn {
  min-width: 220px;
  padding: 1rem 2rem;
  background: white !important;
  color: #1E3A8A !important;
  border: 2px solid white;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border-radius: var(--border-radius);
}

.cta-btn:hover {
  background: #f8fafc !important;
  color: #1E3A8A !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
}

/* Animations */
@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

[data-aos="fade-up"] {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

[data-aos="fade-up"].aos-animate {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive Grid Breakpoints */
@media (min-width: 1400px) {
  .simple-masonry-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    max-width: 1320px;
    margin: 0 auto;
  }
}

@media (min-width: 1200px) and (max-width: 1399px) {
  .simple-masonry-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

@media (min-width: 992px) and (max-width: 1199px) {
  .simple-masonry-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  .simple-masonry-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.8rem;
  }

  #referencesGrid .simple-reference-card {
    padding: 1.2rem 0.8rem;
  }

  #referencesGrid .simple-reference-card h3 {
    font-size: 0.9rem;
  }
}

@media (max-width: 767px) {
  .simple-masonry-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.6rem;
  }

  #referencesGrid .simple-reference-card {
    padding: 1rem 0.6rem;
  }

  #referencesGrid .simple-reference-card h3 {
    font-size: 0.85rem;
  }
}

@media (max-width: 576px) {
  .simple-masonry-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.5rem;
  }

  #referencesGrid .simple-reference-card {
    padding: 0.8rem 0.5rem;
  }

  #referencesGrid .simple-reference-card h3 {
    font-size: 0.8rem;
  }
}

/* Responsive Design for Hero / CTA */
@media (max-width: 1200px) {
  .hero-title { font-size: 3rem; }
}

@media (max-width: 992px) {
  .hero-title { font-size: 2.5rem; }
  .stat-number { font-size: 2.5rem; }
  .stat-icon { width: 60px; height: 60px; }
  .stat-icon i { font-size: 1.5rem; }
  .success-story-card { padding: 2rem 1.5rem; }
  .story-icon { width: 60px; height: 60px; font-size: 1.5rem; }
  .testimonial-card { padding: 2rem; }
  .testimonial-author { flex-direction: column; gap: 1rem; text-align: center; }
  .company-logo { width: 50px; height: 50px; font-size: 1.2rem; }
  .cta-title { font-size: 2rem; }
}

@media (max-width: 768px) {
  .references-hero { height: 40vh; min-height: 300px; }
  .hero-title { font-size: 2rem; }
  .hero-description { font-size: 1.1rem; }
  .stat-card { padding: 2rem 1.5rem; }
  .cta-title { font-size: 2.2rem; }
  .cta-buttons { flex-direction: column; align-items: center; gap: 1rem; }
  .cta-btn { min-width: 280px; width: 100%; max-width: 350px; }
}

@media (max-width: 576px) {
  .references-hero { height: 35vh; min-height: 250px; }
  .hero-title { font-size: 1.8rem; }
  .success-story-card { padding: 1.5rem 1rem; }
  .testimonial-card { padding: 1.5rem; }
  .testimonial-content p { font-size: 1rem; }
  .cta-title { font-size: 1.8rem; }
  .stat-card { padding: 2rem 1rem; }
  .stat-number { font-size: 2rem; }
}

/* === FIX: mobile clipping for reference cards (no webkit) === */

/* Let grid items stretch naturally */
.simple-masonry-grid {
  align-items: stretch; /* was 'start' earlier */
}

/* Make cards auto-height by default; keep a gentle floor on large screens */
#referencesGrid .simple-reference-card {
  height: auto;          /* replaces fixed heights */
  min-height: 160px;     /* preserves desktop feel without cropping */
  overflow: visible;     /* allow content to flow */
}

/* Title handling: no mid-line chopping; allow wrapping */
#referencesGrid .simple-reference-card h3 {
  margin-top: 0.25rem;
  line-height: 1.3;
  word-break: break-word;
  hyphens: auto;
  text-overflow: clip;   /* disable single-line ellipsis */
}

/* Tablet and down */
@media (max-width: 991.98px) {
  #referencesGrid .simple-reference-card {
    min-height: 140px;   /* visual consistency on tablets */
  }
}

/* Mobile */
@media (max-width: 767.98px) {
  #referencesGrid .simple-reference-card {
    min-height: unset;   /* fully flexible on phones */
    padding: 1rem 0.8rem;
  }

  /* Vendor-free 3-line cap (no ellipsis glyph, just clean cut) */
  #referencesGrid .simple-reference-card h3 {
    display: block;
    line-height: 1.3;
    max-height: calc(1.3em * 3);  /* show up to 3 lines */
    overflow: hidden;             /* hide extra lines cleanly */
  }

  /* Give titles more room by trimming logo height a bit */
  #referencesGrid .simple-reference-card img {
    max-height: 50px; /* was 60px */
  }
}

/* Extra-small phones */
@media (max-width: 576px) {
  .simple-masonry-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); /* slightly wider cards -> less wrapping */
    gap: 0.6rem;
  }

  #referencesGrid .simple-reference-card h3 {
    font-size: 0.85rem;  /* improves readability */
    /* keep the same 3-line cap here */
    line-height: 1.3;
    max-height: calc(1.3em * 3);
    overflow: hidden;
  }
}
