/*
|-------------------------------------------------------------------------------
| TeleNews Modern Stylesheet
|-------------------------------------------------------------------------------
|
| This file contains all the main styling for the TeleNews application,
| organized into logical sections for better readability and maintainability.
|
|-------------------------------------------------------------------------------
| Table of Contents:
|-------------------------------------------------------------------------------
|
| 1. CSS CUSTOM PROPERTIES (VARIABLES)
|    - Modern Color Palette (Gradients, Glassmorphism, Text)
|    - Global Spacing, Shadows, Transitions
| 2. GLOBAL & BASE STYLES
|    - HTML, Body, Universal Box-sizing
|    - Smooth Scrolling, Custom Scrollbar
| 3. UTILITIES & HELPER CLASSES
|    - General Message Styles (Success, Error)
|    - Hover Effects (Glow)
|    - Specific Table/Cell Adjustments
| 4. LAYOUT & BACKGROUNDS
|    - Particle Background Effect
| 5. NAVIGATION (HEADER)
|    - Navbar Main Styles
|    - Navbar Brand & Links
| 6. COMPONENTS
|    - Buttons (General, Outline, Social Media Specific, Report Specific, Small Size)
|    - Cards (General, Article Card)
|    - Carousel (Hero Carousel)
|    - Section Headers (Titles, Subtitles, Dividers)
|    - Forms (Inputs, Selects, Date Pickers, Switches)
|    - Modals (General, Profile Edit, Share/Delete/Community Modals)
|    - Loading States (Spinner, Shimmer)
|    - Floating Action Button (FAB)
|    - Badges (Profile Stats)
|    - Tabs (Profile Tabs)
|    - Stats Cards
|    - Activity Timeline
|    - Category Tags
|    - Engagement Stats & Actions
|    - Comments Section (User Comments, Comment Button)
| 7. PROFILE PAGE SPECIFIC STYLES
|    - Profile Header, Avatar, Stats
| 8. SOCIAL FEED & ARTICLES SPECIFIC STYLES
|    - Read Article Button
| 9. ANIMATIONS & KEYFRAMES
|    - Global Animations
| 10. RESPONSIVE DESIGN (MEDIA QUERIES)
|    - Adjustments for various screen sizes
|
*/


/*-------------------------------------------------------------------------------
| 1. CSS CUSTOM PROPERTIES (VARIABLES)
|-------------------------------------------------------------------------------*/
:root {
  /* Modern Color Palette */
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --dark-gradient: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  --success-gradient: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
  --warning-gradient: linear-gradient(135deg, #f7971e 0%, #ffd200 100%);
  --danger-gradient: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);

  /* Dark Theme Colors */
  --glass-bg: rgba(0, 0, 0, 0.2);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);

  /* Text colors - Dark theme only */
  --text-primary: #ecf0f1;
  /* Light text for dark backgrounds */
  --text-secondary: #bdc3c7;
  /* Muted light text */
  --text-light: #ecf0f1;
  /* Same as text-primary for consistency */

  /* Spacing & General Design */
  --border-radius: 20px;
  --border-radius-lg: 30px;
  --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 20px 60px rgba(0, 0, 0, 0.4);
}


/*-------------------------------------------------------------------------------
| 2. GLOBAL & BASE STYLES - DARK THEME
|-------------------------------------------------------------------------------*/
body {
  font-family: "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  padding-top: 60px;
}

/* Dark theme scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #333;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-gradient);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-gradient);
}


/*-------------------------------------------------------------------------------
| 3. UTILITIES & HELPER CLASSES
|-------------------------------------------------------------------------------*/

/* General message styles for forms (e.g., signup, login) */
.signup-message,
.login-message {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--border-radius);
  font-weight: 500;
  text-align: center;
}

/* Success message specific styles */
.success-message {
  background: var(--success-gradient);
  color: black;
  box-shadow: var(--shadow-soft);
}

/* Error message specific styles */
.error-message {
  background: var(--danger-gradient);
  color: black;
  box-shadow: var(--shadow-soft);
}

/* Hover effect for elements to add a glow */
.hover-glow {
  transition: all 0.3s ease;
}

.hover-glow:hover {
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Table styling for better appearance with gradients */
.table {
  border-radius: 5px !important;
  overflow: hidden;
  /* Ensures border-radius applies to corners */
}

/* Specific cell styling for user table actions */
#userTable td.actions-cell {
  white-space: nowrap;
  /* Prevents text wrapping */
  padding: 0.25rem 0.5rem !important;
  width: 1%;
  /* Collapse width */
}


/*-------------------------------------------------------------------------------
| 4. LAYOUT & BACKGROUNDS
|-------------------------------------------------------------------------------*/

/* Particle background effect (moved here from bottom) */
.particles-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.1;
  /* Subtle effect */
}

.particle {
  position: absolute;
  background: var(--primary-gradient);
  /* Particles use primary gradient */
  border-radius: 50%;
  animation: float 6s ease-in-out infinite;
  /* Floating animation */
}

/* Individual particle sizing and animation delays */
.particle:nth-child(1) {
  width: 4px;
  height: 4px;
  left: 10%;
  animation-delay: 0s;
}

.particle:nth-child(2) {
  width: 6px;
  height: 6px;
  left: 20%;
  animation-delay: 1s;
}

.particle:nth-child(3) {
  width: 3px;
  height: 3px;
  left: 30%;
  animation-delay: 2s;
}

.particle:nth-child(4) {
  width: 5px;
  height: 5px;
  left: 40%;
  animation-delay: 3s;
}

.particle:nth-child(5) {
  width: 4px;
  height: 4px;
  left: 50%;
  animation-delay: 4s;
}

.particle:nth-child(6) {
  width: 6px;
  height: 6px;
  left: 60%;
  animation-delay: 5s;
}

.particle:nth-child(7) {
  width: 3px;
  height: 3px;
  left: 70%;
  animation-delay: 6s;
}

.particle:nth-child(8) {
  width: 5px;
  height: 5px;
  left: 80%;
  animation-delay: 7s;
}

.particle:nth-child(9) {
  width: 4px;
  height: 4px;
  left: 90%;
  animation-delay: 8s;
}


/*-------------------------------------------------------------------------------
| 5. NAVIGATION (HEADER)
|-------------------------------------------------------------------------------*/

.navbar {
  background: var(--glass-bg) !important;
  /* Glass effect background */
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  transition: var(--transition);
  padding: 1rem 0;
  z-index: 1030;
  /* Ensure navbar is above other content */
}

.navbar-brand {
  font-size: 1.8rem;
  font-weight: 800;
  background: var(--primary-gradient);
  /* Gradient text */
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: var(--transition);
}

.navbar-brand:hover {
  transform: scale(1.05);
  /* Slight scale on hover */
}

.navbar-nav .nav-link {
  font-weight: 600;
  color: var(--text-primary) !important;
  margin: 0 0.5rem;
  padding: 0.5rem 1rem !important;
  border-radius: var(--border-radius);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  /* For hover animation */
}

/* Active navigation link style */
.navbar-nav .nav-link.active {
  background: var(--primary-gradient);
  color: white !important;
  border-radius: var(--border-radius);
  transition: var(--transition);
}

/* Hover animation for navigation links */
.navbar-nav .nav-link::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--primary-gradient);
  transition: var(--transition);
  z-index: -1;
}

.navbar-nav .nav-link:hover::before {
  left: 0;
}

.navbar-nav .nav-link:hover {
  color: white !important;
  transform: translateY(-2px);
}


/*-------------------------------------------------------------------------------
| 6. COMPONENTS
|-------------------------------------------------------------------------------*/

/* Buttons */
.btn {
  background: var(--primary-gradient);
  border: none;
  border-radius: var(--border-radius);
  color: white;
  font-weight: 600;
  padding: 0.8rem 2rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  /* Consolidating min-height here as it's common for many buttons */
  min-height: 42px;
  /* DELETED: Separate min-heights for social buttons, consolidated here */
}

/* Hover animation for buttons */
.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--secondary-gradient);
  transition: var(--transition);
  z-index: -1;
}

.btn:hover::before {
  left: 0;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
  color: white;
  /* Ensure text remains white on hover */
}

/* Outline Buttons */
.btn-outline {
  background: transparent;
  border: 2px solid;
  border-image: var(--primary-gradient) 1;
  /* Gradient border */
  border-radius: var(--border-radius);
  color: var(--text-primary);
  font-weight: 600;
  padding: 0.8rem 2rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Hover animation for outline buttons */
.btn-outline::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--primary-gradient);
  transition: var(--transition);
  z-index: -1;
}

.btn-outline:hover::before {
  left: 0;
}

.btn-outline:hover {
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

/* Small button size utility */
.btn-sm {
  padding: 0.25rem 0.75rem !important;
  font-size: 0.85rem !important;
  border-radius: 15px !important;
}

/* Social Media Buttons - Specific Gradients */
/*Report Buttons */
.btn-facebook {
  background: linear-gradient(135deg, #1877f2, #4267B2);
}

.btn-facebook::before {
  background: linear-gradient(135deg, #0c3c78, #27408b);
  box-shadow: 0 4px 15px rgba(24, 119, 242, 0.5);
}

.btn-twitter,
.view-report-btn {
  background: linear-gradient(135deg, #1DA1F2, #0d8bd9);
}

.btn-twitter::before,
.view-report-btn::before {
  background: linear-gradient(135deg, #0d95e8, #0c7cd5);
  box-shadow: 0 4px 15px rgba(29, 161, 242, 0.4);
}

.btn-twitter::before,
.view-report-btn::before {
  background: linear-gradient(135deg, #0a4c7a, #0c7cd5);
  box-shadow: 0 4px 15px rgba(29, 161, 242, 0.5);
}

.btn-whatsapp,
.dismiss-report-btn {
  background: linear-gradient(135deg, #25D366, #128C7E);
}

.btn-whatsapp::before,
.dismiss-report-btn::before {
  background: linear-gradient(135deg, #22c55e, #10b981);
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
}

.btn-whatsapp::before,
.dismiss-report-btn::before {
  background: linear-gradient(135deg, #128C7E, #0a5c3f);
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.5);
}

.btn-telegram {
  background: linear-gradient(135deg, #0088cc, #005577);
}

.btn-telegram::before {
  background: linear-gradient(135deg, #004466, #002233);
  box-shadow: 0 4px 15px rgba(0, 136, 204, 0.5);
}

.btn-email {
  background: linear-gradient(135deg, #6c757d, #495057);
}

.btn-email::before {
  background: linear-gradient(135deg, #343a40, #23272b);
  box-shadow: 0 4px 15px rgba(108, 117, 125, 0.5);
}

.approve-report-btn {
  background: linear-gradient(135deg, #ff416c, #ff4b2b);
}

.approve-report-btn::before {
  background: linear-gradient(135deg, #c8002f 0%, #7a1f2b 100%);
  box-shadow: 0 4px 20px rgba(200, 0, 47, 0.5);
}

/* Make extra small buttons for report actions */
.btn-xs {
  padding: 0.1rem 0.3rem !important;
  margin: 0.2rem !important;
  font-size: 0.7rem !important;
  border-radius: 1rem !important;
}

/* Cards (General purpose) */
.card,
.modern-card {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
  color: var(--text-primary);
}

/* Card top border animation */
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-gradient);
  transform: scaleX(0);
  transition: var(--transition);
}

.card:hover::before {
  transform: scaleX(1);
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-hover);
}

/* Specific Article Cards */
.article-card {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
}

/* Article card top border animation */
.article-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent-gradient);
  /* Different gradient for accent */
  transform: scaleX(0);
  transition: var(--transition);
}

.article-card:hover::before {
  transform: scaleX(1);
}

.article-card:hover {
  transform: translateY(-15px) scale(1.02);
  /* More pronounced hover for articles */
  box-shadow: var(--shadow-hover);
}

.article-image {
  height: 250px;
  object-fit: cover;
  width: 100%;
  transition: var(--transition);
  position: relative;
}

.article-card:hover .article-image {
  transform: scale(1.1);
  /* Zoom effect on image */
}

.article-content {
  padding: 2rem;
  position: relative;
}

.article-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
  line-height: 1.4;
  transition: var(--transition);
}

.article-card:hover .article-title {
  background: var(--primary-gradient);
  /* Gradient text on hover */
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.article-description {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.article-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.article-source {
  background: var(--primary-gradient);
  color: white;
  padding: 0.3rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Hero Carousel */
.hero-carousel {
  margin-bottom: 3rem;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  position: relative;
}

.carousel-item {
  height: 400px;
  position: relative;
}

.carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.7);
  /* Darken image for better text contrast */
}

.carousel-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(102, 126, 234, 0.8), rgba(118, 75, 162, 0.2));
}

.carousel-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  padding: 2rem;
  max-width: 90%;
  width: 100%;
}


.carousel-content h2 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  animation: slideInUp 0.8s ease-out;
  line-height: 1.2;
  display: block;
}

.carousel-content p {
  font-size: 1.2rem;
  opacity: 0.9;
  animation: slideInUp 0.8s ease-out 0.2s both;
  line-height: 1.4;
  display: block;
}

.carousel-content .btn {
  animation: slideInUp 0.8s ease-out 0.4s both;
}

/* Carousel Controls */
.carousel-control-prev,
.carousel-control-next {
  width: 60px;
  height: 60px;
  background: var(--glass-bg);
  /* Glass effect controls */
  backdrop-filter: blur(10px);
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  top: 50%;
  transform: translateY(-50%);
  transition: var(--transition);
}

.carousel-control-prev {
  left: 20px;
}

.carousel-control-next {
  right: 20px;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%) scale(1.1);
}

.carousel-indicators {
  bottom: 20px;
    margin-bottom: 0;
}

.carousel-indicators [data-bs-target] {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: 2px solid white;
  transition: var(--transition);
  text-indent: -999px; /* Hide any text */
  overflow: hidden;
}

.carousel-indicators .active {
  background: white;
  transform: scale(1.2);
}

/* Section Headers (Titles, Subtitles, Dividers) */
.section-header {
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
}

.section-title {
  font-size: 3rem;
  font-weight: 800;
  background: var(--primary-gradient);
  /* Gradient title text */
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
  animation: fadeInUp 0.8s ease-out;
}

.section-smaller-title {
  background: var(--primary-gradient);
  /* Gradient smaller title text */
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

.section-divider {
  width: 100px;
  height: 4px;
  background: var(--accent-gradient);
  border-radius: 2px;
  margin: 2rem auto;
  animation: scaleIn 0.8s ease-out 0.4s both;
}

/* Forms (Inputs, Selects, Date Pickers, Switches) */
.search-section {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: 2.5rem;
  margin-bottom: 3rem;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

/* Rotating conic gradient background for search section */
.search-section::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg, transparent, rgba(102, 126, 234, 0.1), transparent);
  animation: rotate 20s linear infinite;
  z-index: -1;
}

.form-control,
.form-select {
  background: rgba(44, 62, 80, 0.7);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--border-radius);
  color: var(--text-primary);
  padding: 1rem 1.5rem;
  font-size: 1rem;
  transition: var(--transition);
  backdrop-filter: blur(10px);
}

.form-control:focus,
.form-select:focus {
  border-color: transparent;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
  background: rgba(52, 73, 94, 0.8);
  transform: translateY(-2px);
  color: var(--text-primary);
}

.form-control::placeholder {
  color: var(--text-secondary);
  opacity: 0.8;
}

.form-control:focus::placeholder {
  color: var(--text-secondary);
}

/* Specific styling for date input */
input[type="date"].form-control {
  background: #fff !important;
  color: #222 !important;
}

/* Form Switches (Bootstrap override) */
.form-check-input:checked {
  background-color: #667eea;
  border-color: #667eea;
}

.form-check-input:focus {
  border-color: #667eea;
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25);
}

/* Modals */
/* General modal content for glass effect */
#shareArticleModal .modal-content,
#deleteSharedArticleModal .modal-content,
#deleteCommentModal .modal-content,
#shareToCommunityModal .modal-content {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
}

/* Modal backdrop transparency */
#shareArticleModal .modal-backdrop,
#deleteSharedArticleModal .modal-backdrop,
#deleteCommentModal .modal-backdrop,
#shareToCommunityModal .modal-backdrop {
  background-color: rgba(0, 0, 0, 0.8);
}

/* Profile Edit Modal Specific Styles */
#editProfileModal .modal-content {
  border-radius: var(--border-radius-lg);
  border: none;
  box-shadow: var(--shadow-hover);
}

#editProfileModal .modal-header {
  background: var(--primary-gradient);
  color: white;
  border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
  border-bottom: none;
}

#editProfileModal .btn-close {
  filter: invert(1);
  /* Invert color for dark background */
}

/* Search Results Modal */
#searchResultsModal .modal-content {
  background: var(--glass-bg);
  /* Using glass var directly */
  border-radius: 1rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Loading States */
.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid var(--glass-border);
  border-top: 4px solid;
  border-image: var(--primary-gradient) 1;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 2rem auto;
}

/* Shimmer effect for loading content */
.profile-loading {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--border-radius);
}

/* Floating Action Button */
.fab {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: var(--primary-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
  z-index: 1000;
  border: none;
}

.fab:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-hover);
  color: white;
}

/* Badges (General and Profile Specific) */
.profile-stats .badge {
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 600;
}

/* Tabs (Specifically Profile Tabs) */
.profile-tabs {
  border: none;
  background: transparent;
}

.profile-tabs .nav-link {
  border: none;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  color: var(--text-secondary);
  font-weight: 600;
  padding: 1rem 1.5rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

/* Underline animation for profile tabs */
.profile-tabs .nav-link::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--primary-gradient);
  transform: scaleX(0);
  transition: var(--transition);
}

.profile-tabs .nav-link.active::before,
.profile-tabs .nav-link:hover::before {
  transform: scaleX(1);
}

.profile-tabs .nav-link.active {
  color: var(--text-primary);
  background: rgba(102, 126, 234, 0.1);
}

.profile-tabs .nav-link:hover {
  color: var(--text-primary);
  background: rgba(102, 126, 234, 0.05);
}

/* Stats Cards (on Profile page) */
.stats-card {
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

/* Stats card top border animation */
.stats-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent-gradient);
  transform: scaleX(0);
  transition: var(--transition);
}

.stats-card:hover::before {
  transform: scaleX(1);
}

.stats-card:hover {
  transform: translateY(-5px);
}

.stats-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  color: white;
  font-size: 1.5rem;
}

/* Specific gradients for stats icons */
.stats-icon.bg-primary {
  background: var(--primary-gradient);
}

.stats-icon.bg-success {
  background: var(--success-gradient);
}

.stats-icon.bg-info {
  background: var(--accent-gradient);
}

.stats-icon.bg-warning {
  background: var(--warning-gradient);
}

/* Activity Timeline (on Profile page) */
.activity-timeline {
  max-height: 500px;
  overflow-y: auto;
  /* Scrollable height */
}

.activity-item {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--glass-border);
  transition: var(--transition);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-item:hover {
  background: rgba(102, 126, 234, 0.05);
  border-radius: var(--border-radius);
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.activity-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

/* Chart Container */
#activityChart {
  max-height: 300px;
  /* Fixed height for chart */
}

/* Category Tags */
.category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.category-tags .form-check {
  background: rgba(102, 126, 234, 0.1);
  border-radius: var(--border-radius);
  padding: 0.5rem 1rem;
  margin: 0;
  transition: var(--transition);
}

.category-tags .form-check:hover {
  background: rgba(102, 126, 234, 0.2);
  transform: translateY(-2px);
}

.category-tags .form-check-input:checked+.form-check-label {
  color: var(--text-primary);
  font-weight: 600;
}

/* Engagement Stats & Actions (for Article Cards/Shared Articles) */
.engagement-stats {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.engagement-stats span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.engagement-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  /* Allow wrapping on smaller screens */
}

.engagement-actions .btn {
  font-size: 0.75rem;
  /* Reduced from 0.85rem */
  padding: 0.2rem 0.6rem;
  /* Reduced from 0.25rem 0.75rem */
  border-radius: 12px;
  /* Slightly smaller radius */
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  transition: all 0.3s ease;
  cursor: pointer;
  min-height: 28px;
  /* Reduced from default */
}

.engagement-actions .btn i {
  font-size: 0.7rem;
  /* Reduced from 0.8rem */
  margin-right: 0.2rem;
  /* Reduced spacing */
}

.engagement-actions .btn:hover {
  transform: translateY(-1px);
}

/* Comment button specific styles */
.comment-btn {
  transition: all 0.3s ease;
}

.comment-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
}

/* Pulse animation for comment button with comments */
.comment-btn.has-comments {
  background-color: rgba(13, 110, 253, 0.1);
  border-color: var(--primary-gradient);
  /* Used primary gradient, assuming that's what var(--primary-color) referred to */
  animation: pulse 2s infinite;
}

/* Comments Section */
.comments-section {
  border-top: 1px solid var(--glass-border);
  margin-top: 15px;
  padding-top: 15px;
}

/* User comments within social feed or comments section */
.user-comment {
  background: rgba(255, 255, 255, 0.8);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  border-left: 4px solid;
  border-image: var(--accent-gradient) 1;
  transition: var(--transition);
}

.user-comment:hover {
  transform: translateX(10px);
  box-shadow: var(--shadow-soft);
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  margin-right: 1rem;
}

.flag-btn {
  background: var(--danger-gradient);
  border: none;
  border-radius: 20px;
  color: white;
  padding: 0.3rem 1rem;
  font-size: 0.8rem;
  transition: var(--transition);
}

.flag-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 5px 15px rgba(255, 65, 108, 0.4);
}

/* Bookmark Actions */
.remove-bookmark-btn {
  opacity: 0;
  transition: var(--transition);
}

.card:hover .remove-bookmark-btn {
  opacity: 1;
}

/* Shared Articles Container (Added/Updated from previous conversation) */
.scrollable-articles-container {
  max-height: 1000px;
  /* Adjust as needed */
  overflow-y: auto;
  padding-right: 15px;
  /* Space for scrollbar */
}

/* Share Modal Button Icon Fixes */
/* This section addresses specific issues with button icons within the share modal */
#shareArticleModal .btn,
#deleteSharedArticleModal .btn,
#deleteCommentModal .btn,
#shareToCommunityModal .btn {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

#shareArticleModal .btn i,
#deleteSharedArticleModal .btn i,
#deleteCommentModal .btn i,
#shareToCommunityModal .btn i {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  text-align: center;
  line-height: 20px;
  margin-right: 0.5rem;
  font-size: 1rem;
}

#shareArticleModal .btn span,
#deleteSharedArticleModal .btn span,
#deleteCommentModal .btn span,
#shareToCommunityModal .btn span {
  flex-grow: 1;
  text-align: center;
  white-space: nowrap;
}


/*-------------------------------------------------------------------------------
| 7. PROFILE PAGE SPECIFIC STYLES
|-------------------------------------------------------------------------------*/

.profile-header {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  border: 1px solid var(--glass-border);
  position: relative;
  overflow: hidden;
}

.profile-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-gradient);
}

.profile-avatar-container {
  display: inline-block;
  position: relative;
}

.profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2.5rem;
  font-weight: 700;
  border: 4px solid white;
  /* White border around avatar */
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
  overflow: hidden;
}

.profile-avatar:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-hover);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-edit-btn {
  position: absolute;
  bottom: 5px;
  right: 5px;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-soft);
}

/* Email and Bio container */
.profile-text-container {
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius);
  padding: 1.2rem 1.5rem;
  margin-bottom: 1.5rem;
  transition: var(--transition);
  box-shadow: var(--shadow-soft);
}

.profile-text-container:hover {
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3);
  transform: translateY(-2px);
}

#profileEmail {
  font-size: 1.05rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(244, 244, 244, 0.08);
  display: block;
}

#profileBio {
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 0;
  line-height: 1.5;
  padding-top: 0.5rem;
}

.label-prefix {
  background: var(--glass-bg);
  padding: 3px 8px;
  border-radius: 4px;
  margin-right: 8px;
  display: inline-block;
  font-weight: bold;
  border-radius: 0.6rem;
}

/* Profile Stats (Badges) */
.profile-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.profile-stats .badge {
  flex-grow: 1;
  flex-basis: auto;
  min-width: fit-content;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
  margin-right: 0 !important;
}

/* Media query for smaller screens (Bootstrap's 'md' breakpoint and below): stack badges in a column */
@media (max-width: 768px) {
  /* Hide Floating Action Button for mobile*/
  .fab {
    display: none !important;
  }

  .profile-stats {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }

  .profile-stats .badge {
    width: 100%;
    max-width: 250px;
    justify-content: center;
    padding: 0.7rem 1rem;
    flex-grow: 0;
    flex-basis: auto;
  }
}

/* Adjust the column widths slightly for better balance, if needed */
/* (This depends on your overall Bootstrap grid structure, but often helps) */
.profile-header .col-md-6 {
  text-align: center;
  /* Center name, email, bio */
}

.profile-header .col-md-3.text-center {
  /* Ensure avatar is centered on all screen sizes in its column */
  display: flex;
  justify-content: center;
}

/* Following System Styles */
.user-avatar-link:hover,
.user-name-link:hover {
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.follow-user-btn,
.unfollow-user-btn {
  transition: all 0.2s ease;
  min-width: 100px;
}

.follow-user-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.unfollow-user-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

/* User list container */
.user-list-container {
  max-height: 600px;
  overflow-y: auto;
}

/* Enhanced user cards */
.user-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.user-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Following tab pills */
.nav-pills .nav-link {
  border-radius: 20px;
  padding: 8px 16px;
  margin-right: 8px;
  transition: all 0.2s ease;
}

.nav-pills .nav-link.active {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

/*-------------------------------------------------------------------------------
| 8. SOCIAL FEED & ARTICLES SPECIFIC STYLES
|-------------------------------------------------------------------------------*/
/* Read Article Button Styles */
.read-article-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  font-size: 0.95rem;
  padding: 0.5rem 1.2rem;
  border-radius: 20px;
  text-align: center;
  transition: var(--transition);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
}

.read-article-btn:hover,
.read-article-btn:focus {
  background: var(--primary-gradient);
  color: #fff;
  border-color: var(--primary);
  text-decoration: none;
}

/*-------------------------------------------------------------------------------
| 9. ANIMATIONS & KEYFRAMES
|-------------------------------------------------------------------------------*/

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-10px);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

/* Scroll animations */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s ease-out;
}

.animate-on-scroll.animated {
  opacity: 1;
  transform: translateY(0);
}


/*-------------------------------------------------------------------------------
| 10. RESPONSIVE DESIGN (MEDIA QUERIES)
|-------------------------------------------------------------------------------*/

/* Max-width: 768px (Medium devices and smaller) */
@media (max-width: 768px) {
  .section-title {
    font-size: 2rem;
  }

  .carousel-content h2 {
    font-size: 1.2rem;
  }

  .carousel-content p {
    font-size: 0.8rem;
  }

  .article-content {
    padding: 1.5rem;
  }

  .search-section {
    padding: 1.5rem;
  }

  .fab {
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }

  /* Profile Specific Responsive */
  .profile-avatar {
    width: 80px;
    height: 80px;
    font-size: 1.8rem;
  }

  .profile-stats .badge {
    font-size: 0.8rem;
    padding: 0.3rem 0.8rem;
    margin-bottom: 0.5rem;
    display: block;
    /* Stack badges vertically */
    text-align: center;
  }

  .profile-tabs .nav-link {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  .stats-card {
    margin-bottom: 1rem;
  }

  .engagement-actions {
    gap: 0.25rem;
  }

  .engagement-actions .btn {
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
  }

  /* General mobile overflow prevention */
  body {
    overflow-x: hidden;
    max-width: 100vw;
  }
  
  .container {
    max-width: 100%;
    padding-left: 15px;
    padding-right: 15px;
    overflow-x: hidden;
  }
  
  /* Fix any long content that might cause horizontal scroll */
  * {
    max-width: 100%;
    box-sizing: border-box;
  }
  
  /* Specific fixes for cards and content */
  .card,
  .modern-card,
  .article-card {
    max-width: 100%;
    overflow: hidden;
  }
  
  /* Fix long text content */
  p, h1, h2, h3, h4, h5, h6 {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
  }
  
  /* Fix navigation on mobile */
  .navbar-nav {
    overflow-x: hidden;
    max-width: 100%;
  }
  
  /* Fix search sections */
  .search-section {
    padding: 1rem;
    overflow-x: hidden;
  }
  
  /* Hide elements that might cause issues on mobile */
  .fab {
    display: none !important;
  }
}

/* Very small mobile devices */
@media (max-width: 480px) {
  .carousel-item {
    height: 330px; /* Very compact on small screens */
  }
  
  .carousel-content {
    padding: 0.5rem;
  }
  
.carousel-content h2 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
  }
  
  .carousel-content p {
    font-size: 0.8rem;
  }
  
  .carousel-content .btn {
    font-size: 0.8rem;
    padding: 0.5rem 1.2rem;
  }

  .carousel-indicators [data-bs-target]{
    width: 4px;
    height: 4px;
  }
}

/* Mobile row-12 class support */
.row-12 {
    display: flex;
    flex-wrap: wrap;
}

.row-12 > * {
    flex: 0 0 100%;
    max-width: 100%;
}

/* Ensure row-12 children behave as full-width columns */
.row-12 .col,
.row-12 .col-1,
.row-12 .col-2,
.row-12 .col-3,
.row-12 .col-4,
.row-12 .col-5,
.row-12 .col-6,
.row-12 .col-7,
.row-12 .col-8,
.row-12 .col-9,
.row-12 .col-10,
.row-12 .col-11,
.row-12 .col-12,
.row-12 .col-auto,
.row-12 .col-sm,
.row-12 .col-sm-1,
.row-12 .col-sm-2,
.row-12 .col-sm-3,
.row-12 .col-sm-4,
.row-12 .col-sm-5,
.row-12 .col-sm-6,
.row-12 .col-sm-7,
.row-12 .col-sm-8,
.row-12 .col-sm-9,
.row-12 .col-sm-10,
.row-12 .col-sm-11,
.row-12 .col-sm-12,
.row-12 .col-md,
.row-12 .col-md-1,
.row-12 .col-md-2,
.row-12 .col-md-3,
.row-12 .col-md-4,
.row-12 .col-md-5,
.row-12 .col-md-6,
.row-12 .col-md-7,
.row-12 .col-md-8,
.row-12 .col-md-9,
.row-12 .col-md-10,
.row-12 .col-md-11,
.row-12 .col-md-12,
.row-12 .col-lg,
.row-12 .col-lg-1,
.row-12 .col-lg-2,
.row-12 .col-lg-3,
.row-12 .col-lg-4,
.row-12 .col-lg-5,
.row-12 .col-lg-6,
.row-12 .col-lg-7,
.row-12 .col-lg-8,
.row-12 .col-lg-9,
.row-12 .col-lg-10,
.row-12 .col-lg-11,
.row-12 .col-lg-12,
.row-12 .col-xl,
.row-12 .col-xl-1,
.row-12 .col-xl-2,
.row-12 .col-xl-3,
.row-12 .col-xl-4,
.row-12 .col-xl-5,
.row-12 .col-xl-6,
.row-12 .col-xl-7,
.row-12 .col-xl-8,
.row-12 .col-xl-9,
.row-12 .col-xl-10,
.row-12 .col-xl-11,
.row-12 .col-xl-12 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    margin-bottom: 1rem;
}

/* Mobile-specific adjustments for row-12 */
@media (max-width: 480px) {
    
    /* Ensure proper spacing */
    .row-12 .card,
    .row-12 .modern-card,
    .row-12 .article-card {
        margin-bottom: 0.75rem;
    }
}

/* Enhanced Bootstrap form switches for better mobile responsiveness */
.form-check-input[type="checkbox"] {
    width: 2em;
    height: 1em;
    margin-top: 0.25em;
    vertical-align: top;
    background-color: #dee2e6;
    background-repeat: no-repeat;
    background-position: left center;
    background-size: contain;
    border: 1px solid rgba(0, 0, 0, 0.25);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    transition: all 0.15s ease-in-out;
}

/* Form switch specific styling */
.form-switch {
    padding-left: 2.5em;
    min-height: 1.5rem;
    display: flex;
    align-items: center;
}

.form-switch .form-check-input {
    width: 2em !important;
    height: 1em !important;
    margin-left: -2.5em;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%280, 0, 0, 0.25%29'/%3e%3c/svg%3e");
    background-position: left center;
    border-radius: 2em;
    transition: all 0.15s ease-in-out;
    min-width: 2em;
    min-height: 1em;
    flex-shrink: 0;
}

.form-switch .form-check-input:focus {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25);
    outline: none;
}

.form-switch .form-check-input:checked {
    background-position: right center;
    background-color: #667eea;
    border-color: #667eea;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
}

.form-switch .form-check-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Inline block switches for admin tables */
.form-check.form-switch.d-inline-block {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding-left: 2.5em;
    margin-bottom: 0;
    vertical-align: middle;
    min-width: 60px;
}

.form-check.form-switch.d-inline-block .form-check-input {
    margin-left: -2.5em;
    margin-top: 0;
    vertical-align: middle;
    position: relative;
}

.form-check.form-switch.d-inline-block .form-check-label {
    margin-left: 0;
    cursor: pointer;
}

/* Table specific switch styling */
.table .form-switch {
    margin: 0;
    padding-left: 2.5em;
    justify-content: center;
    width: 100%;
}

.table .form-switch .form-check-input {
    margin-left: -2.5em;
    margin-right: 0;
}

/* Mobile responsive switches */
@media (max-width: 768px) {
    .form-switch {
        padding-left: 2.8em;
        min-height: 1.8rem;
    }
    
    .form-switch .form-check-input {
        width: 2.4em !important;
        height: 1.3em !important;
        margin-left: -2.8em;
        margin-top: 0;
        /* Larger touch target for mobile */
        min-width: 2.4em;
        min-height: 1.3em;
    }
    
    .form-switch .form-check-label {
        margin-left: 0.5em;
        line-height: 1.3em;
        cursor: pointer;
    }
    
    /* Table switches on mobile */
    .table .form-switch {
        padding-left: 2.8em;
        min-height: 1.8rem;
    }
    
    .table .form-switch .form-check-input {
        margin-left: -2.8em;
        width: 2.4em !important;
        height: 1.3em !important;
    }
    
    /* Inline block switches on mobile */
    .form-check.form-switch.d-inline-block {
        padding-left: 2.8em;
        min-width: 70px;
    }
    
    .form-check.form-switch.d-inline-block .form-check-input {
        margin-left: -2.8em;
        width: 2.4em !important;
        height: 1.3em !important;
    }
}

/* Very small screens */
@media (max-width: 480px) {
    .form-switch .form-check-input {
        width: 2.6em !important;
        height: 1.4em !important;
        margin-left: -3em;
    }
    
    .form-switch {
        padding-left: 3em;
        min-height: 2rem;
    }
    
    /* Table adjustments for very small screens */
    .table td {
        padding: 0.5rem 0.3rem;
        font-size: 0.85rem;
    }
    
    .table .form-switch {
        padding-left: 3em;
        min-width: 75px;
    }
    
    .table .form-switch .form-check-input {
        margin-left: -3em;
        width: 2.6em !important;
        height: 1.4em !important;
    }
    
    /* Better spacing for table headers */
    .table th {
        padding: 0.75rem 0.3rem;
        font-size: 0.85rem;
    }
}

/* Dark theme support for switches */
.modern-card .form-switch .form-check-input,
.table-dark .form-switch .form-check-input {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.modern-card .form-switch .form-check-input:checked,
.table-dark .form-switch .form-check-input:checked {
    background-color: #667eea;
    border-color: #667eea;
}

/* Hover effects for better UX */
.form-switch .form-check-input:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-switch .form-check-input:active:not(:disabled) {
    transform: scale(0.95);
}

/* Loading state for switches */
.form-switch.loading .form-check-input {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.form-switch.loading .form-check-input::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    border: 2px solid transparent;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}