﻿/* Modern Landing Page CSS for Kocaeli Eğitim Desteği */

/* Performance optimizations */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-display: swap;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Prevent layout shift */
img {
  height: auto;
  max-width: 100%;
}

/* GPU acceleration for animations */
.animate-fade-in,
.animate-bounce-slow,
.animate-scale {
  will-change: transform, opacity;
  transform: translateZ(0);
}

/* Primary color gradients with #064169 */

/* Widget Debug Styles */
[id*="widget-loader"] {
  position: fixed !important;
  z-index: 9999 !important;
  pointer-events: auto !important;
  visibility: visible !important;
  opacity: 1 !important;
  display: block !important;
}

/* Accesslity Widget Styles */
[data-version*="1.0"] {
  position: fixed !important;
  z-index: 9999 !important;
  pointer-events: auto !important;
}

/* Extension Debug */
#extension-kjloo {
  position: fixed !important;
  z-index: 9998 !important;
  pointer-events: auto !important;
}

.bg-gradient-primary {
  background: linear-gradient(135deg, #064169 0%, #0a5a7a 100%);
}

.bg-gradient-secondary {
  background: linear-gradient(135deg, #673ab7 0%, #9c27b0 100%);
}

.bg-gradient-stats {
  background: linear-gradient(135deg, #064169 0%, #673ab7 50%, #9c27b0 100%);
}

/* Hero background overlay */
.hero-gradient {
  background: linear-gradient(
    135deg,
    rgba(6, 65, 105, 0.9),
    rgba(103, 58, 183, 0.8)
  );
}

/* Page loading animation */
body {
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

/* Custom scrollbar with primary colors */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #064169, #673ab7);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #053555, #9c27b0);
}

/* Focus states for accessibility */
button:focus,
a:focus {
  outline: 2px solid #064169;
  outline-offset: 2px;
}

/* Header scroll behavior - initially hidden, shows on scroll */
header {
  transform: translateY(-100%);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Show header when scrolled class is added by JavaScript */
header.scrolled {
  transform: translateY(0);
  opacity: 1;
}

/* Alternative CSS-only approach using scroll-driven animations (modern browsers) */
@supports (animation-timeline: scroll()) {
  header {
    animation: header-reveal linear;
    animation-timeline: scroll();
    animation-range: 0px 100px;
  }

  @keyframes header-reveal {
    0% {
      transform: translateY(-100%);
      opacity: 0;
    }
    100% {
      transform: translateY(0);
      opacity: 1;
    }
  }
}

/* Fallback for browsers without scroll-driven animations */
@supports not (animation-timeline: scroll()) {
  header {
    transform: translateY(-100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
}

/* Animation keyframes */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes slideInLeft {
  from {
    transform: translateX(-50px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

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

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* Animation utility classes */
.animate-fade-in {
  animation: fadeIn 0.8s ease-out forwards;
}

.animate-slide-up {
  animation: slideUp 0.8s ease-out forwards;
}

.animate-slide-left {
  animation: slideInLeft 0.8s ease-out forwards;
}

.animate-slide-right {
  animation: slideInRight 0.8s ease-out forwards;
}

.animate-pulse-custom {
  animation: pulse 2s ease-in-out infinite;
}

/* Hover effects */
.hover-lift {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 25px 50px rgba(6, 65, 105, 0.15);
}

/* Card shadows with primary color */
.shadow-primary {
  box-shadow: 0 10px 25px rgba(6, 65, 105, 0.1);
}

.shadow-primary-lg {
  box-shadow: 0 20px 40px rgba(6, 65, 105, 0.15);
}

/* Glass effect */
.glass-effect {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Primary text color utility */
.text-primary {
  color: #064169 !important;
}

.text-primary-dark {
  color: #053555 !important;
}

.text-primary-light {
  color: #0a5a7a !important;
}

/* Ensure nav links keep their white color */
header a,
nav a,
footer a {
  color: inherit;
}

/* Text gradients */
.text-gradient-primary {
  background: linear-gradient(135deg, #064169, #673ab7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gradient-secondary {
  background: linear-gradient(135deg, #673ab7, #9c27b0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Loading spinner */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f4f6;
  border-top: 3px solid #064169;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Mobile responsive utilities */
@media (max-width: 640px) {
  .text-responsive {
    font-size: 0.875rem;
  }

  .p-responsive {
    padding: 1rem;
  }

  .hero-title-mobile {
    font-size: 2.5rem;
    line-height: 1.1;
  }
}

/* Print styles */
@media print {
  .no-print {
    display: none !important;
  }

  .print-friendly {
    background: white !important;
    color: black !important;
  }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Hero Background Images - Mobilde broshure.webp kullanımı */
.hero-mobile-bg {
  position: relative;
}

/* Desktop hero background - default */
.hero-mobile-bg img {
  display: block;
  width: 100%;
  height: 110%;
  object-fit: cover;

  transition: all 0.3s ease-in-out;
}

/* Mobile'de broshure.webp kullan */
@media (max-width: 1200px) {
  .hero-mobile-bg img {
    content: url("../images/mobilBG27.webp");
    object-fit: cover;
    object-position: center center;
  }
}

@media (max-width: 768px) {
  .hero-mobile-bg img {
    content: url("../images/mobilBG27.webp");
    object-fit: cover;
    object-position: center center;
  }
}

@media (max-width: 480px) {
  .hero-mobile-bg img {
    content: url("../images/mobilBG27.webp");
    object-fit: cover;
    object-position: center;
  }

  body #mdp-accesslity-sidebar.mdp-accesslity-sidebar-right {
    right: -120vw;
  }
  .mdp-accesslity-aside-is-open-right
    #mdp-accesslity-sidebar.mdp-accesslity-sidebar-right {
    right: 0vw;
  }
  .mdp-global-close-btn {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 9999999999;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: transparent;
    color: #fff;
    font-size: 22px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease;
  }

  .mdp-global-close-btn:hover {
    background: #fff;
    color: #000;
  }
}
