/* static/css/components.css */

/* ——— Flash Message Fix ——— */
/* Flash mesajı içeren container'dan hemen sonra gelen hero'yu yukarı taşır */
.container.mt-3 + section.hero {
  margin-top: -1rem;
}

/* ——— Hero Section ——— */
.hero {
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-400) 100%);
  color: #fff;
  padding: clamp(4rem, 15vw, 8rem) 1rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='rgba(255,255,255,0.05)' fill-rule='evenodd'/%3E%3C/svg%3E");
  opacity: 0.5;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 1rem;
  position: relative;
}

.hero p.lead {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  margin-bottom: 2rem;
  opacity: 0.9;
}

.hero .btn {
  margin: 0 .5rem .75rem;
  min-width: 150px;
  padding: .75rem 1.5rem;
  font-size: 1rem;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.hero .btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.hero .btn:hover::before {
  width: 300px;
  height: 300px;
}

/* ——— Features Section ——— */
.features {
  padding: clamp(3rem, 8vw, 6rem) 1rem;
  background-color: var(--gray-50);
  position: relative;
}

.features::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    var(--gray-200) 15%, 
    var(--gray-200) 85%, 
    transparent 100%
  );
}

.features h2 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  margin-bottom: 2.5rem;
  text-align: center;
}

.features .row > [class*="col-"] {
  display: flex;
}

.features .card {
  background: white;
  border: 1px solid var(--gray-100);
  border-radius: 1rem;
  padding: 2rem;
  height: 100%;
  transition: all 0.3s ease;
}

.features .card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px -10px rgba(var(--primary-rgb), 0.1);
  border-color: var(--gray-200);
}

.features .card .bi {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--primary-500);
}

/* ——— Skeleton Loading ——— */
@keyframes shimmer {
  0%   { background-position: -500px 0; }
  100% { background-position: 500px 0;  }
}
.skeleton {
  background: linear-gradient(90deg,
    #e0e0e0 0%, #f5f5f5 50%, #e0e0e0 100%);
  background-size: 1000px 100%;
  animation: shimmer 1.5s infinite;
  border-radius: .75rem;
}

/* ——— NEW: Courses horizontal carousel & styling ——— */
.courses-scroll {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 1rem 0;
}
.courses-scroll .card {
  flex: 0 0 300px;
  scroll-snap-align: start;
  transition: transform .3s, box-shadow .3s;
}
.courses-scroll .card:hover {
  transform: translateY(-6px);
  box-shadow: 0 0.75rem 1.5rem rgba(0,0,0,0.1);
}

/* Custom scrollbar */
.courses-scroll::-webkit-scrollbar {
  height: 8px;
}
.courses-scroll::-webkit-scrollbar-track {
  background: var(--gray-light);
}
.courses-scroll::-webkit-scrollbar-thumb {
  background-color: var(--primary);
  border-radius: 4px;
}

/* ——— NEW: "Learn More" anchor button styling ——— */
a.btn-outline-light.learn-more {
  border-color: #fff;
  color: #fff;
  transition: background-color .3s, color .3s;
}
a.btn-outline-light.learn-more:hover {
  background-color: rgba(255,255,255,0.2);
  color: #fff;
}

/* ——— UTILITY: hide default focus outline and add custom ——— */
:focus { outline: none; }
.btn:focus {
  box-shadow: 0 0 0 3px rgba(0,83,186,.4);
}

/* ——— NEW: Notifications dropdown styling ——— */
.notifications-menu {
  width: 400px !important;
  max-height: 600px !important;
  overflow-y: auto;
  border: none !important;
  border-radius: 1rem !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15) !important;
  padding: 1rem !important;
  margin-top: 1rem !important;
  right: -10px !important;
}

.notifications-menu .dropdown-item {
  padding: 1rem !important;
  border-radius: 0.75rem !important;
  margin-bottom: 0.75rem !important;
  white-space: normal !important;
  transition: all 0.2s ease !important;
  border: 1px solid transparent !important;
  background: #fff !important;
}

.notifications-menu .dropdown-item:last-child {
  margin-bottom: 0 !important;
}

.notifications-menu .dropdown-item.unread {
  background-color: #f0f7ff !important;
  border-color: #e1efff !important;
  font-weight: 500 !important;
}

.notifications-menu .dropdown-item:hover {
  background-color: #f8faff !important;
  transform: translateX(4px);
}

.notifications-menu .dropdown-item p {
  margin-bottom: 0.25rem !important;
  line-height: 1.5 !important;
  font-size: 0.9375rem !important;
  color: #1a1a1a !important;
}

.notifications-menu .dropdown-item small {
  font-size: 0.8125rem !important;
  color: #6c757d !important;
  display: block !important;
}

.notifications-menu .dropdown-divider {
  margin: 0.75rem 0 !important;
  border-color: #e9ecef !important;
}

.notifications-menu .dropdown-item.text-center {
  color: #0d6efd !important;
  font-weight: 500 !important;
  padding: 0.75rem !important;
}

/* Empty state styling */
.notifications-menu .empty-state {
  padding: 2rem 1rem !important;
  text-align: center !important;
}

.notifications-menu .empty-state i {
  font-size: 1.75rem !important;
  color: #6c757d !important;
  margin-bottom: 0.75rem !important;
}

.notifications-menu .empty-state p {
  color: #6c757d !important;
  margin: 0 !important;
}

/* Notification badge in navbar */
.nav-item .badge.bg-danger {
  position: absolute !important;
  top: -6px !important;
  right: -6px !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  min-width: 20px !important;
  height: 20px !important;
  padding: 0 6px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 2px solid #fff !important;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2) !important;
}

/* Notification icon button */
.nav-item .btn-light {
  background: rgba(255, 255, 255, 0.15) !important;
  border: none !important;
  padding: 0.625rem !important;
  width: 44px !important;
  height: 44px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  transition: all 0.2s ease !important;
  border-radius: 0.75rem !important;
}

.nav-item .btn-light:hover {
  background: rgba(255, 255, 255, 0.25) !important;
  transform: translateY(-2px) !important;
}

.nav-item .btn-light i {
  font-size: 1.25rem !important;
  color: #fff !important;
}

/* Unread indicator dot */
.notifications-menu .badge.bg-primary {
  width: 10px !important;
  height: 10px !important;
  padding: 0 !important;
  background-color: #0d6efd !important;
  display: inline-block !important;
  margin-left: 0.75rem !important;
  flex-shrink: 0 !important;
  border-radius: 50% !important;
}

/* ——— Form Elements ——— */
.form-control {
  border: 1px solid var(--gray-200);
  transition: all 0.2s ease;
}

.form-control:hover {
  border-color: var(--gray-300);
}

.form-control:focus {
  border-color: var(--primary-400);
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.1);
}

/* ——— Buttons ——— */
.btn {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
  z-index: 1;
}

.btn:hover::after {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-500));
  border: none;
  box-shadow: 0 2px 4px rgba(var(--primary-rgb), 0.2);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(var(--primary-rgb), 0.3);
}

/* ——— Custom Scrollbar ——— */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--gray-100);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 4px;
  transition: all 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* ——— (Any other existing rules go above) ——— */

/* ——— Post Cards ——— */
.post-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: none;
  background: var(--surface-card);
}

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg) !important;
}

.post-card .card-body {
  padding: 1.5rem;
}

.post-card .avatar-wrapper {
  width: 40px;
  height: 40px;
  overflow: hidden;
  border-radius: 50%;
  border: 2px solid var(--primary-100);
}

.post-card .avatar-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-card .post-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.post-card .card-title {
  color: var(--text-primary);
  font-weight: 600;
  margin: 0.75rem 0;
  line-height: 1.4;
}

.post-card .card-text {
  color: var(--text-secondary);
  line-height: 1.6;
}

.post-card .post-stats {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.post-card .post-stats i {
  margin-right: 0.25rem;
}

.post-card .post-stats span + span {
  margin-left: 1rem;
}

.post-card .btn-view {
  padding: 0.375rem 1rem;
  font-size: 0.875rem;
  border-radius: 20px;
  transition: all 0.2s ease;
}

.post-card .btn-view:hover {
  background: var(--primary-100);
  color: var(--primary-700);
}

.post-card .attachment-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background: var(--surface-hover);
  border-radius: 16px;
  transition: all 0.2s ease;
}

.post-card .attachment-link:hover {
  background: var(--primary-50);
  color: var(--primary-700);
}
