/* 
 * SOS Kids v1.0 - Main Stylesheet
 */

:root {
  --primary: #FF6B35;
  --secondary: #4ECDC4;
  --accent: #FFE66D;
  --success: #6BCB77;
  --danger: #FF6B6B;
  --dark: #2D3561;
  --light: #F7F9FC;
  --purple: #A855F7;
  
  --font-heading: 'Nunito', sans-serif;
  --font-body: 'Open Sans', sans-serif;
  
  --border-radius-sm: 8px;
  --border-radius-md: 16px;
  --border-radius-lg: 24px;
  --border-radius-pill: 50px;
  
  --shadow-sm: 0 4px 6px rgba(0,0,0,0.05);
  --shadow-md: 0 10px 15px rgba(0,0,0,0.1);
  --shadow-lg: 0 20px 25px rgba(0,0,0,0.15);
  
  --gradient-hero: linear-gradient(135deg, #FF6B35 0%, #4ECDC4 100%);
}

body {
  font-family: var(--font-body);
  background-color: var(--light);
  color: var(--dark);
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6, .navbar-brand {
  font-family: var(--font-heading);
  font-weight: 700;
}

/* Navbar */
.navbar {
  background-color: var(--dark);
  box-shadow: var(--shadow-sm);
  padding: 1rem 0;
}

.navbar-brand {
  color: var(--light) !important;
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.navbar-brand span {
  color: var(--accent);
}

.nav-link {
  color: rgba(247, 249, 252, 0.8) !important;
  font-weight: 600;
  transition: all 0.3s ease;
  margin: 0 0.5rem;
  border-radius: var(--border-radius-pill);
  padding: 0.5rem 1rem !important;
}

.nav-link:hover, .nav-link.active {
  color: var(--light) !important;
  background-color: rgba(255, 255, 255, 0.1);
}

.search-form {
  position: relative;
}

.search-form input {
  border-radius: var(--border-radius-pill);
  padding-left: 1.5rem;
  padding-right: 3rem;
  border: none;
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--light);
}

.search-form input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.search-form input:focus {
  background-color: rgba(255, 255, 255, 0.2);
  color: var(--light);
  box-shadow: none;
}

.search-form button {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--light);
}

.btn-login {
  background-color: var(--primary);
  color: #fff;
  border-radius: var(--border-radius-pill);
  font-weight: 700;
  padding: 0.5rem 1.5rem;
  transition: all 0.3s;
  border: 2px solid var(--primary);
}

.btn-login:hover {
  background-color: transparent;
  color: var(--primary);
}

/* Hero Section */
.hero-section {
  background: var(--gradient-hero);
  padding: 6rem 0;
  color: white;
  text-align: center;
  border-bottom-left-radius: 40px;
  border-bottom-right-radius: 40px;
  margin-bottom: 3rem;
  box-shadow: var(--shadow-md);
}

.hero-section h1 {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.hero-section p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.hero-search {
  max-width: 600px;
  margin: 0 auto;
}

.hero-search input {
  border-radius: var(--border-radius-pill);
  padding: 1rem 1.5rem;
  font-size: 1.1rem;
  border: none;
  box-shadow: var(--shadow-sm);
}

.hero-search .btn {
  border-radius: var(--border-radius-pill);
  padding: 1rem 2rem;
  background-color: var(--dark);
  color: white;
  font-weight: 700;
  border: none;
  margin-left: -50px;
  z-index: 2;
  position: relative;
}

/* Category Cards */
.category-card {
  background: white;
  border-radius: var(--border-radius-md);
  padding: 2rem 1rem;
  text-align: center;
  text-decoration: none;
  color: var(--dark);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  display: block;
  margin-bottom: 1.5rem;
  border: 2px solid transparent;
}

.category-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: var(--shadow-md);
  border-color: var(--secondary);
  color: var(--primary);
}

.category-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

.category-title {
  font-weight: 700;
  font-family: var(--font-heading);
  margin: 0;
}

/* Video Cards */
.video-card {
  background: white;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.video-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.video-thumbnail {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  background-color: #eee;
  overflow: hidden;
}

.video-thumbnail img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.video-card:hover .video-thumbnail img {
  transform: scale(1.05);
}

.video-duration {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0,0,0,0.8);
  color: white;
  padding: 2px 8px;
  border-radius: var(--border-radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
}

.video-info {
  padding: 1.25rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.video-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--dark);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.video-title:hover {
  color: var(--primary);
}

.video-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #6c757d;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid #f0f0f0;
}

.video-author {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #6c757d;
}

.video-author img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.video-stats span {
  margin-left: 10px;
}

/* Badges */
.badge-category {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  background: var(--purple);
  color: white;
  padding: 4px 12px;
  border-radius: var(--border-radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Comment Section */
.comments-section {
  background: white;
  border-radius: var(--border-radius-md);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  margin-top: 2rem;
}

.comment {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.comment-avatar img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.comment-content {
  flex-grow: 1;
  background: var(--light);
  padding: 1rem;
  border-radius: var(--border-radius-md);
}

.comment-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.comment-author {
  font-weight: 700;
  color: var(--dark);
}

.comment-time {
  font-size: 0.8rem;
  color: #6c757d;
}

.comment-actions {
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

.comment-actions button {
  background: none;
  border: none;
  color: #6c757d;
  font-weight: 600;
  padding: 0;
  margin-right: 1rem;
  transition: color 0.2s;
}

.comment-actions button:hover {
  color: var(--primary);
}

.comment-reply {
  margin-left: 4rem;
  position: relative;
}

.comment-reply::before {
  content: '';
  position: absolute;
  left: -2rem;
  top: -1rem;
  bottom: 2rem;
  width: 2px;
  background-color: #dee2e6;
}

/* Like Animation */
@keyframes heartBounce {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); color: var(--danger); }
  100% { transform: scale(1); color: var(--danger); }
}

.btn-like.liked i {
  animation: heartBounce 0.3s ease-in-out forwards;
}

/* Loaders */
.loader-spinner {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  border: 3px solid rgba(0,0,0,0.1);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Footer */
.footer {
  background-color: var(--dark);
  color: white;
  padding: 4rem 0 2rem;
  margin-top: 4rem;
  border-top-left-radius: 40px;
  border-top-right-radius: 40px;
}

.footer h5 {
  color: var(--accent);
  margin-bottom: 1.5rem;
  font-weight: 800;
}

.footer ul {
  list-style: none;
  padding: 0;
}

.footer ul li {
  margin-bottom: 0.75rem;
}

.footer ul li a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  transition: color 0.3s;
}

.footer ul li a:hover {
  color: white;
}

.footer-social a {
  display: inline-block;
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.1);
  color: white;
  border-radius: 50%;
  text-align: center;
  line-height: 40px;
  margin-right: 10px;
  transition: all 0.3s;
}

.footer-social a:hover {
  background: var(--primary);
  transform: translateY(-3px);
}

.emergency-help {
  background: linear-gradient(135deg, var(--danger) 0%, #ff8a8a 100%);
  border-radius: var(--border-radius-md);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.emergency-help h5 {
  color: white;
  margin-bottom: 1rem;
}

.emergency-help .btn {
  background-color: white;
  color: var(--danger);
  border-radius: var(--border-radius-pill);
  font-weight: 800;
  width: 100%;
}

/* Alerts / Flash Messages */
.flash-messages {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1050;
  max-width: 350px;
}

.alert {
  border-radius: var(--border-radius-md);
  border: none;
  box-shadow: var(--shadow-md);
}

.alert-success {
  background-color: var(--success);
  color: white;
}

.alert-danger {
  background-color: var(--danger);
  color: white;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: white;
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-sm);
}

.empty-state i {
  font-size: 4rem;
  color: #dee2e6;
  margin-bottom: 1rem;
}

/* Pagination */
.pagination {
  margin-top: 2rem;
  justify-content: center;
}

.page-item .page-link {
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 5px;
  color: var(--dark);
  border: none;
  background: white;
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}

.page-item.active .page-link {
  background-color: var(--primary);
  color: white;
}

.page-item:not(.active) .page-link:hover {
  background-color: var(--light);
}

/* Responsive Grid for Videos */
@media (max-width: 575.98px) {
  .hero-section h1 { font-size: 2.5rem; }
  .video-card { margin-bottom: 1rem; }
  .search-form { display: none; } /* Hide search in navbar on mobile */
}

@media (min-width: 576px) and (max-width: 767.98px) {
  .row-cols-md-2 > * { flex: 0 0 auto; width: 50%; }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .row-cols-lg-3 > * { flex: 0 0 auto; width: 33.33333333%; }
}

@media (min-width: 992px) {
  .row-cols-xl-4 > * { flex: 0 0 auto; width: 25%; }
}

/* =========================================
   Blog & Article Typography (SEO Friendly)
   ========================================= */
.hover-card {
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.hover-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md) !important;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-content {
  font-family: var(--font-body);
  color: #2D3748;
  font-size: 1.1rem;
  line-height: 1.85;
}

.article-content h2 {
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--dark);
  font-size: 1.65rem;
  margin-top: 2.2rem;
  margin-bottom: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid rgba(45, 53, 97, 0.08);
}

.article-content h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--dark);
  font-size: 1.35rem;
  margin-top: 1.8rem;
  margin-bottom: 0.8rem;
}

.article-content p {
  margin-bottom: 1.4rem;
}

.article-content blockquote {
  background: rgba(255, 107, 53, 0.06);
  border-left: 4px solid var(--primary);
  border-radius: 0 16px 16px 0;
  padding: 1.25rem 1.75rem;
  margin: 1.8rem 0;
  font-style: italic;
  color: #4A5568;
}

.article-content blockquote p:last-child {
  margin-bottom: 0;
}

.article-content ul, 
.article-content ol {
  padding-left: 1.8rem;
  margin-bottom: 1.5rem;
}

.article-content li {
  margin-bottom: 0.5rem;
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 16px;
  margin: 1.5rem 0;
  box-shadow: var(--shadow-sm);
}

