@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #FAFAFA; /* Off-white */
  font-family: 'Inter', 'Segoe UI', sans-serif;
  color: #1F2937; /* Dark gray for text */
  margin: 0;
  padding: 8px;
  overflow-x: hidden;
}

.sidebar {
  position: fixed;
  top: 20px;
  width: 240px;
  height: calc(100vh - 40px);
  background: linear-gradient(145deg, #E0F2FE, #F3F4F6); /* Light blue to light gray */
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 1000;
  box-shadow: 0 30px 60px rgba(107, 114, 128, 0.2); /* Soft gray shadow */
  transform: perspective(1200px) rotateY(-5deg);
  transition: transform 0.5s ease-in-out, box-shadow 0.5s ease-in-out;
}

.sidebar:hover {
  transform: perspective(1200px) rotateY(0deg);
  box-shadow: 0 40px 80px rgba(59, 130, 246, 0.3); /* Deeper blue shadow */
}

.sidebar-menu {
  flex-grow: 1;
  position: relative;
  transform: skewY(-15deg);
  margin-top: 20px;
}

.sidebar-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-menu ul li {
  position: relative;
  width: 100%;
  background: rgba(243, 244, 246, 0.8); /* Light gray base */
  padding: 15px 20px;
  z-index: var(--i);
  transition: transform 0.5s ease-in-out, background 0.5s ease-in-out;
}

.sidebar-menu ul li:hover {
  background: linear-gradient(to right, #E0F2FE, #3B82F6); /* Light to deeper blue */
  transform: translateX(30px);
}

.sidebar-menu ul li::before {
  content: '';
  position: absolute;
  top: 0;
  left: -30px;
  width: 30px;
  height: 100%;
  background: rgba(243, 244, 246, 0.9); /* Light gray side */
  transform-origin: right;
  transform: skewY(45deg);
  transition: background 0.5s ease-in-out;
}

.sidebar-menu ul li:hover::before {
  background: #2563EB; /* Darker blue */
}

.sidebar-menu ul li::after {
  content: '';
  position: absolute;
  top: -30px;
  left: 0;
  width: 100%;
  height: 30px;
  background: rgba(243, 244, 246, 0.9); /* Light gray top */
  transform-origin: bottom;
  transform: skewX(45deg);
  transition: background 0.5s ease-in-out;
}

.sidebar-menu ul li:hover::after {
  background: #E5E7EB; /* Slightly darker gray */
}

.sidebar-menu ul li:last-child::after {
  box-shadow: -70px 90px 15px rgba(0, 0, 0, 0.1); /* Softer shadow */
}

.sidebar-link {
  color: #1F2937; /* Dark gray */
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 14px;
  text-decoration: none;
  display: flex;
  align-items: center;
  letter-spacing: 0.05em;
  transition: color 0.3s ease-in-out;
}

.sidebar-link:hover {
  color: #3B82F6; /* Deeper blue */
}

.sidebar-link i {
  color: #6B7280; /* Soft gray */
  margin-right: 10px;
  font-size: 16px;
  transition: transform 0.3s ease-in-out;
}

.sidebar-link:hover i {
  color: #3B82F6;
  transform: scale(1.2) rotate(5deg);
}

.logout-link {
  background: linear-gradient(to right, #3B82F6, #93C5FD); /* Blue gradient */
  padding: 15px 20px;
  border-radius: 5px;
  color: #FFFFFF;
  transition: transform 0.5s ease-in-out, background 0.5s ease-in-out;
}

.logout-link:hover {
  background: linear-gradient(to right, #2563EB, #60A5FA); /* Darker blue gradient */
  transform: translateX(20px) translateZ(5px);
  color: #FFFFFF;
}

.sidebar-footer {
  text-align: center;
  padding: 20px 0;
  transform: skewY(-15deg);
}

.sidebar-logo {
  box-shadow: 0 5px 15px rgba(107, 114, 128, 0.2); /* Soft gray */
  transition: transform 0.3s ease-in-out;
}

.sidebar-logo:hover {
  transform: scale(1.2) translateZ(10px);
  box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3); /* Deeper blue */
}

.main {
  margin-left: 280px;
  margin-top: 40px;
  background: transparent;
  padding: 3rem;
  min-height: calc(100vh - 100px);
}

body.no-sidebar .main {
  margin: 0 auto;
  max-width: 800px;
  padding: 20px;
  margin-top: 20px;
}

.komi-login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 2rem;
  background: transparent;
}

.login-card {
  background: #FFFFFF; /* White card */
  color: #1F2937; /* Dark gray text */
  padding: 4rem; /* Increased for balance */
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(107, 114, 128, 0.15); /* Soft gray */
  transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
  max-width: 600px; /* Increased width */
  width: 100%;
  animation: slideUp 0.8s ease-in-out;
}

.login-card:hover {
  box-shadow: 0 15px 40px rgba(59, 130, 246, 0.2); /* Deeper blue */
  transform: translateZ(10px);
}

.logo-3d {
  display: block;
  margin: 0 auto 20px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(107, 114, 128, 0.1);
  transition: transform 0.3s ease-in-out;
}

.logo-3d:hover {
  transform: scale(1.1) translateZ(5px);
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.2);
}

.komi-blue {
  color: #3B82F6; /* Deeper blue */
}

h1, h3 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  color: #1F2937; /* Dark gray for readability */
  font-weight: 700;
  text-align: center;
  margin-bottom: 15px;
}

h4 {
  color: #1F2937;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
}

.divider-3d {
  border-top: 3px solid #E0F2FE; /* Light blue */
  margin: 1.5rem 0;
  box-shadow: 0 4px 10px rgba(107, 114, 128, 0.1);
  transition: box-shadow 0.3s ease-in-out;
}

.divider-3d:hover {
  box-shadow: 0 6px 15px rgba(59, 130, 246, 0.2);
}

.login-form {
  margin-top: 2rem;
}

.input-3d {
  background: #F9FAFB; /* Very light gray */
  border: 1px solid #E5E7EB; /* Light gray */
  border-radius: 8px;
  padding: 12px 14px;
  color: #1F2937;
  transition: border-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.input-3d:focus {
  border-color: #3B82F6;
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.3);
  outline: none;
}

.input-3d::placeholder {
  color: #9CA3AF; /* Gray */
}

.btn-3d {
  background: linear-gradient(to right, #E0F2FE, #3B82F6); /* Blue gradient */
  border: none;
  padding: 12px 24px;
  font-weight: 600;
  border-radius: 6px;
  color: #1F2937;
  transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.btn-3d:hover {
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
  transform: translateY(-2px);
}

.alert-error {
  background: #FEF2F2; /* Light red */
  color: #DC2626; /* Red */
  padding: 0.8rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(107, 114, 128, 0.1);
}

.footer {
  background: #F9FAFB; /* Light gray */
  color: #6B7280; /* Soft gray */
  font-size: 0.9rem;
  text-align: center;
  padding: 1.5rem;
  box-shadow: 0 5px 15px rgba(107, 114, 128, 0.1);
  margin-top: 2rem;
  margin-left: 280px;
  transition: box-shadow 0.3s ease-in-out;
}

.footer:hover {
  box-shadow: 0 10px 20px rgba(59, 130, 246, 0.2);
}

.footer-glow-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(224, 242, 254, 0.2), transparent);
  opacity: 0.3;
  animation: glowPulse 2s ease-in-out infinite alternate;
}

.footer-text {
  font-size: 0.8rem;
  color: #6B7280;
  margin-top: 1rem;
}

.komi-home-container {
  background: #FFFFFF; /* White */
  padding: 0;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(107, 114, 128, 0.1);
  transition: box-shadow 0.3s ease-in-out;
}

.komi-home-container:hover {
  box-shadow: 0 15px 40px rgba(59, 130, 246, 0.2);
}

.komi-home-note {
  margin: 2rem auto;
  max-width: 800px;
  font-weight: 500;
  font-size: 0.95rem;
  color: #1F2937;
  background: #F9FAFB; /* Light gray */
  border-left: 4px solid #E0F2FE; /* Light blue */
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 10px rgba(107, 114, 128, 0.1);
  transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.komi-home-note:hover {
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
  transform: translateZ(5px);
}

.hero-section {
  position: relative;
  text-align: center;
  padding: 4rem 1.5rem;
  background: #F9FAFB; /* Light gray */
  border-radius: 12px;
  margin-bottom: 3rem;
  box-shadow: 0 10px 30px rgba(107, 114, 128, 0.1);
  transition: box-shadow 0.3s ease-in-out;
}

.hero-section:hover {
  box-shadow: 0 15px 40px rgba(59, 130, 246, 0.2);
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.hero-text {
  font-size: 1.2rem;
  color: #6B7280; /* Soft gray */
  max-width: 600px;
  margin: 1rem auto;
  transition: transform 0.3s ease-in-out;
}

.hero-text:hover {
  transform: translateZ(5px);
}

.hero-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(224, 242, 254, 0.2), transparent);
  opacity: 0.3;
  animation: glowPulse 2s ease-in-out infinite alternate;
}

.features-section {
  padding: 2rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: #FFFFFF; /* White */
  padding: 1.5rem;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 5px 15px rgba(107, 114, 128, 0.1);
  transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.feature-card:hover {
  box-shadow: 0 10px 20px rgba(59, 130, 246, 0.2);
  transform: translateZ(5px);
}

.feature-card i {
  font-size: 32px;
  color: #3B82F6; /* Deeper blue */
  margin-bottom: 1rem;
  transition: transform 0.3s ease-in-out;
}

.feature-card:hover i {
  transform: scale(1.1) rotate(3deg);
}

.about-section {
  padding: 2rem 1.5rem;
  max-width: 800px;
  margin: 0 auto;
}

.about-content {
  text-align: center;
}

.content-text {
  font-size: 1rem;
  color: #6B7280;
  margin-bottom: 1.5rem;
  transition: transform 0.3s ease-in-out;
}

.content-text:hover {
  transform: translateZ(5px);
}

.platforms-section {
  padding: 2rem 1.5rem;
  max-width: 800px;
  margin: 0 auto;
}

.platform-list {
  list-style: none;
  padding: 0;
  margin-bottom: 1.5rem;
}

.platform-list li {
  background: #F9FAFB; /* Light gray */
  padding: 10px 20px;
  margin-bottom: 8px;
  border-radius: 8px;
  font-size: 1rem;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 8px rgba(107, 114, 128, 0.1);
  transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.platform-list li:hover {
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
  transform: translateX(5px);
}

.platform-list li i {
  margin-right: 10px;
  font-size: 18px;
  color: #3B82F6;
  transition: transform 0.3s ease-in-out;
}

.platform-list li:hover i {
  transform: scale(1.1) rotate(3deg);
}

.dev-note {
  font-size: 0.8rem;
  color: #F87171; /* Soft red */
  margin-left: 8px;
}

.cta-button {
  font-size: 1rem;
  padding: 12px 30px;
}

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

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

@keyframes glowPulse {
  from { opacity: 0.2; }
  to { opacity: 0.4; }
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 65%;
  transform: translateY(-50%);
  color: #3B82F6;
  font-size: 1rem;
  transition: color 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.password-toggle:hover {
  color: #2563EB; /* Darker blue */
  transform: translateY(-50%) scale(1.1);
}

.hero-section .welcome-wrapper {
  max-width: 100%;
  display: block;
  margin: 0 auto;
  text-align: center;
}

.hero-section .welcome-text {
  display: inline-flex;
  flex-wrap: wrap;
  font-size: clamp(1.2rem, 4vw, 2rem);
  font-weight: 700;
  text-align: center;
  margin: 0 auto 15px;
  color: #1F2937; /* Dark gray for readability */
  white-space: nowrap;
  line-height: 1.3;
  font-family: 'Arial', 'Segoe UI Emoji', sans-serif;
}

.hero-section .welcome-text span {
  display: inline-block;
  margin: 0;
  padding: 0;
}

.hero-section .welcome-text .space {
  width: 0.4rem;
}

.hero-section .welcome-text .komi-blue {
  color: #3B82F6; /* Deeper blue */
}

.hero-section .welcome-text span:not(.komi-blue, .space) {
  color: #1F2937; /* Dark gray for readability */
}

@media (max-width: 768px) {
  .sidebar {
    width: 200px;
    padding: 15px 0;
    transform: perspective(1200px) rotateY(-3deg);
    top: 10px;
    height: calc(100vh - 20px);
  }
  .sidebar-menu ul li {
    padding: 10px 15px;
  }
  .sidebar-link {
    font-size: 12px;
  }
  .sidebar-link i {
    font-size: 14px;
  }
  .main {
    margin-left: 220px;
    padding: 1.5rem;
    margin-top: 30px;
  }
  .footer {
    margin-left: 220px;
    padding: 1rem;
  }
  .hero-section {
    padding: 2rem 1rem;
  }
  .hero-section .welcome-text {
    font-size: clamp(1rem, 3.5vw, 1.5rem);
  }
  .hero-section .welcome-wrapper {
    padding: 0 5px;
  }
  .login-card {
    padding: 3rem; /* Adjusted for mobile */
    max-width: 500px; /* Responsive width */
  }
}

body.no-sidebar .footer {
  margin-left: 0;
}

/* TikTok Scraper Styles */
.fade-in {
    animation: fadeIn 0.8s ease-in-out;
}

.tiktok-table {
    border: 1px solid #E5E7EB; /* Light gray */
    border-radius: 8px;
    overflow: hidden;
    background: #FFFFFF; /* White */
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.1); /* Soft gray */
    transition: box-shadow 0.3s ease-in-out;
}

.tiktok-table:hover {
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.15); /* Deeper blue */
}

.tiktok-table th {
    background: #E0F2FE; /* Light blue */
    font-weight: 600;
    padding: 1rem;
    color: #1F2937; /* Dark gray */
    font-size: 0.95rem;
    text-transform: capitalize;
}

.tiktok-table td {
    padding: 1rem;
    border-top: 1px solid #E5E7EB; /* Light gray */
    color: #1F2937; /* Dark gray */
    font-size: 0.9rem;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tiktok-table tr:nth-child(even) {
    background: #F8FAFC; /* Very light gray */
}

.tiktok-table tr:hover {
    background: #E0F2FE; /* Light blue */
    transition: background 0.2s ease;
}

.table-responsive {
    margin-top: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
}

.btn-success {
    background: linear-gradient(to right, #28A745, #38D57A); /* Green gradient */
    border: none;
    color: #FFFFFF;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-success:hover {
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.3); /* Green shadow */
    transform: translateY(-2px);
}

.metrics-note {
    background: #F8FAFC; /* Very light gray */
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.05); /* Soft gray */
    margin-top: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.metrics-note:hover {
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.1); /* Deeper blue */
    transform: translateY(-2px);
}

.metrics-note h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1F2937; /* Dark gray */
    margin-bottom: 1rem;
}

.metrics-note p {
    font-size: 0.95rem;
    color: #6B7280; /* Soft gray */
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.text-success {
    color: #28A745; /* Green */
}

.text-warning {
    color: #D97706; /* Orange */
}

.form-range {
    accent-color: #3B82F6; /* Deeper blue */
}

.form-range::-webkit-slider-thumb {
    background: #3B82F6; /* Deeper blue */
    cursor: pointer;
    transition: transform 0.2s ease;
}

.form-range::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.form-range::-moz-range-thumb {
    background: #3B82F6; /* Deeper blue */
    cursor: pointer;
}

.range-value {
    font-weight: 600;
    color: #3B82F6; /* Deeper blue */
    margin-left: 0.5rem;
}

.alert-success {
    background: #E6FFED; /* Light green */
    color: #2E7D32; /* Dark green */
    border: none;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.1);
}

.alert-warning {
    background: #FFF8E1; /* Light yellow */
    color: #D97706; /* Orange */
    border: none;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.1);
}

.alert-danger {
    background: #FFF1F0; /* Light red */
    color: #C53030; /* Red */
    border: none;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(197, 48, 48, 0.1);
}

.alert-dismissible .btn-close {
    background: none;
    opacity: 0.7;
}

.alert-dismissible .btn-close:hover {
    opacity: 1;
}

.small {
    font-size: 0.85rem;
}

@media (max-width: 767px) {
    .tiktok-table th, .tiktok-table td {
        padding: 0.5rem;
        font-size: 0.85rem;
    }
    .metrics-note {
        padding: 1rem;
    }
    .tiktok-table td {
        max-width: 150px;
    }
}


/* TikTok Scraper Styles */
.tiktok.main {
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border-radius: 20px;
    padding: 3rem;
    margin: 2rem auto;
    max-width: 1100px;
    box-shadow: 0 10px 30px rgba(96, 165, 250, 0.2);
    font-family: 'Inter', 'Segoe UI', sans-serif;
    position: relative;
    overflow: hidden;
}

.tiktok.header-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.tiktok.header-icon {
    font-size: 80px;
    color: #1e3a8a;
    transition: transform 0.4s ease, color 0.4s ease;
}

.tiktok.header-icon:hover {
    transform: rotate(360deg);
    color: #60a5fa;
}

.tiktok.header-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e3a8a;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tiktok.header-subtitle {
    font-size: 1rem;
    color: #64748b;
    margin-bottom: 2rem;
    font-weight: 400;
}

.tiktok.header-divider {
    border-top: 3px solid #60a5fa;
    width: 100px;
    margin: 0 auto 2.5rem;
    transition: width 0.5s ease;
}

.tiktok.header-divider:hover {
    width: 200px;
}

/* Form Styles */
.tiktok.stForm {
    background: #ffffff;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(96, 165, 250, 0.15);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.tiktok.stForm:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(96, 165, 250, 0.25);
}

.tiktok.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.tiktok.form-group {
    display: flex;
    flex-direction: column;
}

.tiktok.form-label {
    font-size: 1rem;
    font-weight: 600;
    color: #1e3a8a;
    margin-bottom: 0.75rem;
    letter-spacing: 0.5px;
}

.tiktok.form-control {
    border: 2px solid #e0e7ff;
    border-radius: 10px;
    padding: 0.85rem 1.25rem;
    font-size: 1rem;
    background: #f8fafc;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.tiktok.form-control:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 12px rgba(96, 165, 250, 0.3);
    transform: scale(1.02);
    outline: none;
}

.tiktok.form-control-range {
    accent-color: #60a5fa;
    height: 8px;
    border-radius: 5px;
    background: #e0e7ff;
    cursor: pointer;
}

.tiktok.range-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.tiktok.range-output {
    font-size: 1rem;
    color: #60a5fa;
    font-weight: 500;
    padding: 0.5rem 1rem;
    background: #eff6ff;
    border-radius: 8px;
}

/* Toggle Switch */
.tiktok.toggle-container {
    display: flex;
    justify-content: center;
}

.tiktok.toggle-wrapper {
    position: relative;
    display: flex;
    background: #e0e7ff;
    border-radius: 50px;
    padding: 0.3rem;
    width: 100%;
    max-width: 360px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.4s ease;
}

.tiktok.toggle-wrapper:hover {
    box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tiktok.toggle-wrapper input[type="radio"] {
    display: none;
}

.tiktok.toggle-label {
    flex: 1;
    text-align: center;
    padding: 0.8rem;
    font-size: 1rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    border-radius: 50px;
    transition: color 0.3s ease, transform 0.3s ease, border 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tiktok.toggle-label:hover {
    color: #1e3a8a;
    transform: scale(1.05);
}

.tiktok.toggle-wrapper input:checked + .tiktok.toggle-label {
    color: #60a5fa;
    border: 2px solid #60a5fa;
}

.tiktok.toggle-label::after {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.tiktok.toggle-label:hover::after {
    opacity: 1;
}

/* Form Note and Buttons */
.tiktok.form-note {
    display: block;
    color: #f59e0b;
    font-size: 0.9rem;
    margin: 1.5rem 0;
    font-weight: 500;
    text-align: center;
}

.tiktok.button-group, .tiktok.download-group {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
    visibility: visible !important;
    opacity: 1 !important;
}

.tiktok.stButton {
    position: relative;
    background: linear-gradient(to right, #60a5fa, #3b82f6);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: pulse 2s infinite;
}

.tiktok.stButton:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(96, 165, 250, 0.5);
}

.tiktok.stButton:active {
    transform: translateY(0);
    animation: none;
}

.tiktok.stDownloadButton {
    position: relative;
    background: linear-gradient(to right, #34d399, #10b981);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: pulse 2s infinite;
}

.tiktok.stDownloadButton:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(52, 211, 153, 0.5);
}

.tiktok.stDownloadButton:active {
    transform: translateY(0);
    animation: none;
}

.tiktok.button-text {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.tiktok.button-spinner {
    display: none;
    width: 24px;
    height: 24px;
    border: 4px solid #ffffff;
    border-top: 4px solid transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.tiktok.stButton.loading .tiktok.button-text {
    display: none;
}

.tiktok.stButton.loading .tiktok.button-spinner {
    display: inline-block;
}

/* Flash Messages */
.tiktok.flash-container {
    margin-bottom: 2rem;
}

.tiktok.alert {
    border-radius: 12px;
    padding: 1rem 1.5rem;
    font-size: 0.95rem;
    position: relative;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tiktok.alert-success {
    background: #ecfdf5;
    color: #065f46;
}

.tiktok.alert-danger {
    background: #fef2f2;
    color: #991b1b;
}

.tiktok.alert-warning {
    background: #fffbeb;
    color: #d97706;
}

/* DataFrame Styling */
.tiktok.stDataFrame {
    margin: 2.5rem 0;
    overflow-x: auto;
    max-width: 100%;
    max-height: 500px;
    overflow-y: auto;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(96, 165, 250, 0.15);
    background: #ffffff;
    visibility: visible !important;
    opacity: 1 !important;
}

.tiktok.stDataFrame table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 2px solid #e0e7ff;
    font-size: 0.95rem;
}

.tiktok.stDataFrame th {
    background: #f1f5f9;
    font-weight: 600;
    padding: 1.2rem;
    color: #1e3a8a;
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom: 2px solid #e0e7ff;
}

.tiktok.stDataFrame td {
    padding: 1.2rem;
    border-top: 1px solid #e0e7ff;
    word-break: break-word;
    max-width: 300px;
}

.tiktok.stDataFrame tr:nth-child(even) {
    background: #f8fafc;
}

.tiktok.stDataFrame tr:hover {
    background: #eff6ff;
    transition: background 0.3s ease;
}

.tiktok.download-group {
    text-align: center;
    margin-top: 1.5rem;
}

/* Metrics Section */
.tiktok.metrics-container {
    margin: 3rem 0;
    padding: 2rem;
    background: linear-gradient(135deg, #f8fafc, #eff6ff);
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(96, 165, 250, 0.15);
}

.tiktok.metrics-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 1.5rem;
}

.tiktok.metrics-item {
    font-size: 1rem;
    color: #64748b;
    line-height: 1.6;
    margin: 0 0 1rem 0;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
    box-sizing: border-box;
}

.tiktok.metrics-label {
    font-weight: 600;
    color: #60a5fa;
    display: inline-block;
    margin-right: 0.4rem;
    vertical-align: middle;
    white-space: nowrap;
}


/* Animations */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(96, 165, 250, 0.5); }
    70% { box-shadow: 0 0 0 15px rgba(96, 165, 250, 0); }
    100% { box-shadow: 0 0 0 0 rgba(96, 165, 250, 0); }
}

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

/* Responsive Design */
@media (min-width: 768px) {
    .tiktok.form-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 767px) {
    .tiktok.main {
        padding: 1.5rem;
        margin: 1rem;
    }
    .tiktok.stForm {
        padding: 1.5rem;
    }
    .tiktok.header-title {
        font-size: 2rem;
    }
    .tiktok.toggle-wrapper {
        max-width: 100%;
    }
    .tiktok.button-group, .tiktok.download-group {
        flex-direction: column;
        gap: 1rem;
    }
    .tiktok.stButton, .tiktok.stDownloadButton {
        width: 100%;
        padding: 0.8rem;
    }
}

@media (max-width: 576px) {
    .tiktok.stDataFrame table {
        font-size: 0.85rem;
    }
    .tiktok.stDataFrame th, .tiktok.stDataFrame td {
        padding: 0.8rem;
    }
}

.tiktok.stStopButton {
    position: relative;
    background: linear-gradient(to right, #ef4444, #f87171);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.tiktok.stStopButton:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.5);
}
.tiktok.stStopButton:active {
    transform: translateY(0);
}

.tiktok.stStopButton {
    position: relative;
    background: linear-gradient(to right, #ef4444, #f87171);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.tiktok.stStopButton:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.5);
}
.tiktok.stStopButton:active {
    transform: translateY(0);
}

/* Reddit Scraper Styles */
.reddit.main {
    background: linear-gradient(135deg, #ffffff, #fff7f5);
    border-radius: 20px;
    padding: 3rem;
    margin: 2rem auto;
    max-width: 1100px;
    box-shadow: 0 10px 30px rgba(255, 69, 0, 0.2);
    font-family: 'Inter', 'Segoe UI', sans-serif;
    position: relative;
    overflow: hidden;
}
.reddit.header-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}
.reddit.header-icon {
    font-size: 80px;
    color: #FF4500;
    transition: transform 0.4s ease, color 0.4s ease;
}
.reddit.header-icon:hover {
    transform: rotate(360deg);
    color: #ff6f61;
}
.reddit.header-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #FF4500;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.reddit.header-subtitle {
    font-size: 1rem;
    color: #64748b;
    margin-bottom: 2rem;
    font-weight: 400;
}
.reddit.header-divider {
    border-top: 3px solid #ff6f61;
    width: 100px;
    margin: 0 auto 2.5rem;
    transition: width 0.5s ease;
}
.reddit.header-divider:hover {
    width: 200px;
}
.reddit.stForm {
    background: #ffffff;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(255, 69, 0, 0.15);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.reddit.stForm:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(255, 69, 0, 0.25);
}
.reddit.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}
.reddit.form-group {
    display: flex;
    flex-direction: column;
}
.reddit.form-label {
    font-size: 1rem;
    font-weight: 600;
    color: #FF4500;
    margin-bottom: 0.75rem;
    letter-spacing: 0.5px;
}
.reddit.form-control {
    border: 2px solid #ffe7e0;
    border-radius: 10px;
    padding: 0.85rem 1.25rem;
    font-size: 1rem;
    background: #fff7f5;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}
.reddit.form-control:focus {
    border-color: #ff6f61;
    box-shadow: 0 0 12px rgba(255, 69, 0, 0.3);
    transform: scale(1.02);
    outline: none;
}
.reddit.form-control-range {
    accent-color: #ff6f61;
    height: 8px;
    border-radius: 5px;
    background: #ffe7e0;
    cursor: pointer;
}
.reddit.range-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.reddit.range-output {
    font-size: 1rem;
    color: #ff6f61;
    font-weight: 500;
    padding: 0.5rem 1rem;
    background: #fff1ed;
    border-radius: 8px;
}
.reddit.toggle-container {
    display: flex;
    justify-content: center;
}
.reddit.toggle-wrapper {
    position: relative;
    display: flex;
    background: #ffe7e0;
    border-radius: 50px;
    padding: 0.3rem;
    width: 100%;
    max-width: 360px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.4s ease;
}
.reddit.toggle-wrapper:hover {
    box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.15);
}
.reddit.toggle-wrapper input[type="radio"] {
    display: none;
}
.reddit.toggle-label {
    flex: 1;
    text-align: center;
    padding: 0.8rem;
    font-size: 1rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    border-radius: 50px;
    transition: color 0.3s ease, transform 0.3s ease, border 0.3s ease;
    position: relative;
    overflow: hidden;
}
.reddit.toggle-label:hover {
    color: #FF4500;
    transform: scale(1.05);
}
.reddit.toggle-wrapper input:checked + .reddit.toggle-label {
    color: #ff6f61;
    border: 2px solid #ff6f61;
}
.reddit.toggle-label::after {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background: radial-gradient(circle, rgba(255, 69, 0, 0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}
.reddit.toggle-label:hover::after {
    opacity: 1;
}
.reddit.form-note {
    display: block;
    color: #f59e0b;
    font-size: 0.9rem;
    margin: 1.5rem 0;
    font-weight: 500;
    text-align: center;
}
.reddit.button-group, .reddit.download-group {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
    visibility: visible !important;
    opacity: 1 !important;
}
.reddit.stButton {
    position: relative;
    background: linear-gradient(to right, #ff6f61, #FF4500);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: pulse 2s infinite;
}
.reddit.stButton:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(255, 69, 0, 0.5);
}
.reddit.stButton:active {
    transform: translateY(0);
    animation: none;
}
.reddit.stDownloadButton {
    position: relative;
    background: linear-gradient(to right, #34d399, #10b981);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: pulse 2s infinite;
}
.reddit.stDownloadButton:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(52, 211, 153, 0.5);
}
.reddit.stDownloadButton:active {
    transform: translateY(0);
    animation: none;
}
.reddit.button-text {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.reddit.button-spinner {
    display: none;
    width: 24px;
    height: 24px;
    border: 4px solid #ffffff;
    border-top: 4px solid transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.reddit.stButton.loading .reddit.button-text {
    display: none;
}
.reddit.stButton.loading .reddit.button-spinner {
    display: inline-block;
}
.reddit.flash-container {
    margin-bottom: 2rem;
}
.reddit.alert {
    border-radius: 12px;
    padding: 1rem 1.5rem;
    font-size: 0.95rem;
    position: relative;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.reddit.alert-success {
    background: #ecfdf5;
    color: #065f46;
}
.reddit.alert-danger {
    background: #fef2f2;
    color: #991b1b;
}
.reddit.alert-warning {
    background: #fffbeb;
    color: #d97706;
}
.reddit.stDataFrame {
    margin: 2.5rem 0;
    overflow-x: auto;
    max-width: 100%;
    max-height: 500px;
    overflow-y: auto;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(255, 69, 0, 0.15);
    background: #ffffff;
    visibility: visible !important;
    opacity: 1 !important;
}
.reddit.stDataFrame table.reddit-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 2px solid #ffe7e0;
    font-size: 0.95rem;
}
.reddit.stDataFrame th {
    background: #f1f5f9;
    font-weight: 600;
    padding: 1.2rem;
    color: #FF4500;
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom: 2px solid #ffe7e0;
}
.reddit.stDataFrame td {
    padding: 1.2rem;
    border-top: 1px solid #ffe7e0;
    word-break: break-word;
    max-width: 300px;
}
.reddit.stDataFrame tr:nth-child(even) {
    background: #fff7f5;
}
.reddit.stDataFrame tr:hover {
    background: #fff1ed;
    transition: background 0.3s ease;
}
.reddit.download-group {
    text-align: center;
    margin-top: 1.5rem;
}
.reddit.metrics-container {
    margin: 3rem 0;
    padding: 2rem;
    background: linear-gradient(135deg, #fff7f5, #fff1ed);
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(255, 69, 0, 0.15);
}
.reddit.metrics-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #FF4500;
    margin-bottom: 1.5rem;
}
.reddit.metrics-item {
    font-size: 1rem;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 1rem;
}
.reddit.metrics-label {
    font-weight: 600;
    color: #ff6f61;
}
@media (min-width: 768px) {
    .reddit.form-grid {
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 767px) {
    .reddit.main {
        padding: 1.5rem;
        margin: 1rem;
    }
    .reddit.stForm {
        padding: 1.5rem;
    }
    .reddit.header-title {
        font-size: 2rem;
    }
    .reddit.toggle-wrapper {
        max-width: 100%;
    }
    .reddit.button-group, .reddit.download-group {
        flex-direction: column;
        gap: 1rem;
    }
    .reddit.stButton, .reddit.stDownloadButton {
        width: 100%;
        padding: 0.8rem;
    }
}
@media (max-width: 576px) {
    .reddit.stDataFrame table.reddit-table {
        font-size: 0.85rem;
    }
    .reddit.stDataFrame th, .reddit.stDataFrame td {
        padding: 0.8rem;
    }
}


/* Instagram Scraper Styles */
.instagram.main {
    background: linear-gradient(135deg, #ffffff, #f9fafb);
    border-radius: 20px;
    padding: 3rem;
    margin: 2rem auto;
    max-width: 1100px;
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.2);
    font-family: 'Inter', 'Segoe UI', sans-serif;
    position: relative;
    overflow: hidden;
}
.instagram.header-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}
.instagram.header-icon {
    font-size: 80px;
    color: #4c1d95;
    transition: transform 0.4s ease, color 0.4s ease;
}
.instagram.header-icon:hover {
    transform: rotate(360deg);
    color: #8b5cf6;
}
.instagram.header-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #4c1d95;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.instagram.header-subtitle {
    font-size: 1rem;
    color: #6b7280;
    margin-bottom: 2rem;
    font-weight: 400;
}
.instagram.header-divider {
    border-top: 3px solid #8b5cf6;
    width: 100px;
    margin: 0 auto 2.5rem;
    transition: width 0.5s ease;
}
.instagram.header-divider:hover {
    width: 200px;
}

/* Form Styles */
.instagram.stForm {
    background: #ffffff;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.15);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.instagram.stForm:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.25);
}
.instagram.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}
.instagram.form-group {
    display: flex;
    flex-direction: column;
}
.instagram.form-label {
    font-size: 1rem;
    font-weight: 600;
    color: #4c1d95;
    margin-bottom: 0.75rem;
    letter-spacing: 0.5px;
}
.instagram.form-control {
    border: 2px solid #ede9fe;
    border-radius: 10px;
    padding: 0.85rem 1.25rem;
    font-size: 1rem;
    background: #f9fafb;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}
.instagram.form-control:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.3);
    transform: scale(1.02);
    outline: none;
}
.instagram.form-control-range {
    accent-color: #8b5cf6;
    height: 8px;
    border-radius: 5px;
    background: #ede9fe;
    cursor: pointer;
}
.instagram.range-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.instagram.range-output {
    font-size: 1rem;
    color: #8b5cf6;
    font-weight: 500;
    padding: 0.5rem 1rem;
    background: #f5f3ff;
    border-radius: 8px;
}
.instagram.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
}
.instagram.checkbox-container input[type="checkbox"] {
    accent-color: #8b5cf6;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Toggle Switch */
.instagram.toggle-container {
    display: flex;
    justify-content: center;
}
.instagram.toggle-wrapper {
    position: relative;
    display: flex;
    background: #ede9fe;
    border-radius: 50px;
    padding: 0.3rem;
    width: 100%;
    max-width: 480px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.4s ease;
}
.instagram.toggle-wrapper:hover {
    box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.15);
}
.instagram.toggle-wrapper input[type="radio"] {
    display: none;
}
.instagram.toggle-label {
    flex: 1;
    text-align: center;
    padding: 0.8rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    border-radius: 50px;
    transition: color 0.3s ease, transform 0.3s ease, border 0.3s ease;
    position: relative;
    overflow: hidden;
}
.instagram.toggle-label:hover {
    color: #4c1d95;
    transform: scale(1.05);
}
.instagram.toggle-wrapper input:checked + .instagram.toggle-label {
    color: #8b5cf6;
    border: 2px solid #8b5cf6;
}
.instagram.toggle-label::after {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}
.instagram.toggle-label:hover::after {
    opacity: 1;
}

/* Form Note and Buttons */
.instagram.form-note {
    display: block;
    color: #d97706;
    font-size: 0.9rem;
    margin: 1.5rem 0;
    font-weight: 500;
    text-align: center;
}
.instagram.button-group, .instagram.download-group {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
    visibility: visible !important;
    opacity: 1 !important;
}
.instagram.stButton {
    position: relative;
    background: linear-gradient(to right, #8b5cf6, #a78bfa);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: pulse 2s infinite;
}
.instagram.stButton:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.5);
}
.instagram.stButton:active {
    transform: translateY(0);
    animation: none;
}
.instagram.stDownloadButton {
    position: relative;
    background: linear-gradient(to right, #34d399, #10b981);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: pulse 2s infinite;
}
.instagram.stDownloadButton:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(52, 211, 153, 0.5);
}
.instagram.stDownloadButton:active {
    transform: translateY(0);
    animation: none;
}
.instagram.button-text {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.instagram.button-spinner {
    display: none;
    width: 24px;
    height: 24px;
    border: 4px solid #ffffff;
    border-top: 4px solid transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.instagram.stButton.loading .instagram.button-text {
    display: none;
}
.instagram.stButton.loading .instagram.button-spinner {
    display: inline-block;
}

/* Flash Messages */
.instagram.flash-container {
    margin-bottom: 2rem;
}
.instagram.alert {
    border-radius: 12px;
    padding: 1rem 1.5rem;
    font-size: 0.95rem;
    position: relative;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.instagram.alert-success {
    background: #ecfdf5;
    color: #065f46;
}
.instagram.alert-danger {
    background: #fef2f2;
    color: #991b1b;
}
.instagram.alert-warning {
    background: #fffbeb;
    color: #d97706;
}

/* DataFrame Styling */
.instagram.stDataFrame {
    margin: 2.5rem 0;
    overflow-x: auto;
    max-width: 100%;
    max-height: 500px;
    overflow-y: auto;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.15);
    background: #ffffff;
    visibility: visible !important;
    opacity: 1 !important;
}
.instagram-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 2px solid #ede9fe;
    font-size: 0.95rem;
}
.instagram-table th {
    background: #f3f4f6;
    font-weight: 600;
    padding: 1.2rem;
    color: #4c1d95;
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom: 2px solid #ede9fe;
}
.instagram-table td {
    padding: 1.2rem;
    border-top: 1px solid #ede9fe;
    word-break: break-word;
    max-width: 300px;
}
.instagram-table tr:nth-child(even) {
    background: #f9fafb;
}
.instagram-table tr:hover {
    background: #f5f3ff;
    transition: background 0.3s ease;
}
.instagram.download-group {
    text-align: center;
    margin-top: 1.5rem;
}

/* Metrics Section */
.instagram.metrics-container {
    margin: 3rem 0;
    padding: 2rem;
    background: linear-gradient(135deg, #f9fafb, #f5f3ff);
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.15);
}
.instagram.metrics-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4c1d95;
    margin-bottom: 1.5rem;
}
.instagram.metrics-item {
    font-size: 1rem;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 1rem;
}
.instagram.metrics-label {
    font-weight: 600;
    color: #8b5cf6;
}

/* Animations */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.5); }
    70% { box-shadow: 0 0 0 15px rgba(139, 92, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0); }
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (min-width: 768px) {
    .instagram.form-grid {
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 767px) {
    .instagram.main {
        padding: 1.5rem;
        margin: 1rem;
    }
    .instagram.stForm {
        padding: 1.5rem;
    }
    .instagram.header-title {
        font-size: 2rem;
    }
    .instagram.toggle-wrapper {
        max-width: 100%;
    }
    .instagram.button-group, .instagram.download-group {
        flex-direction: column;
        gap: 1rem;
    }
    .instagram.stButton, .instagram.stDownloadButton {
        width: 100%;
        padding: 0.8rem;
    }
}
@media (max-width: 576px) {
    .instagram-table {
        font-size: 0.85rem;
    }
    .instagram-table th, .instagram-table td {
        padding: 0.8rem;
    }
}

.instagram.stStopButton {
    position: relative;
    background: linear-gradient(to right, #ef4444, #f87171);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.instagram.stStopButton:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.5);
}
.instagram.stStopButton:active {
    transform: translateY(0);
}

.instagram.stStopButton {
    position: relative;
    background: linear-gradient(to right, #ef4444, #f87171);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.instagram.stStopButton:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.5);
}
.instagram.stStopButton:active {
    transform: translateY(0);
}

/* Facebook Scraper Styles */
.facebook.main {
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border-radius: 20px;
    padding: 3rem;
    margin: 2rem auto;
    max-width: 1100px;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.2);
    font-family: 'Inter', 'Segoe UI', sans-serif;
    position: relative;
    overflow: hidden;
}
.facebook.header-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}
.facebook.header-icon {
    font-size: 80px;
    color: #3b82f6;
    transition: transform 0.4s ease, color 0.4s ease;
}
.facebook.header-icon:hover {
    transform: rotate(360deg);
    color: #60a5fa;
}
.facebook.header-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #3b82f6;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.facebook.header-subtitle {
    font-size: 1rem;
    color: #64748b;
    margin-bottom: 2rem;
    font-weight: 400;
}
.facebook.header-divider {
    border-top: 3px solid #60a5fa;
    width: 100px;
    margin: 0 auto 2.5rem;
    transition: width 0.5s ease;
}
.facebook.header-divider:hover {
    width: 200px;
}
/* Form Styles */
.facebook.stForm {
    background: #ffffff;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.15);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.facebook.stForm:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.25);
}
.facebook.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}
.facebook.form-group {
    display: flex;
    flex-direction: column;
}
.facebook.form-label {
    font-size: 1rem;
    font-weight: 600;
    color: #3b82f6;
    margin-bottom: 0.75rem;
    letter-spacing: 0.5px;
}
.facebook.form-control {
    border: 2px solid #e0e7ff;
    border-radius: 10px;
    padding: 0.85rem 1.25rem;
    font-size: 1rem;
    background: #f8fafc;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}
.facebook.form-control:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.3);
    transform: scale(1.02);
    outline: none;
}
.facebook.form-control-range {
    accent-color: #60a5fa;
    height: 8px;
    border-radius: 5px;
    background: #e0e7ff;
    cursor: pointer;
}
.facebook.range-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.facebook.range-output {
    font-size: 1rem;
    color: #60a5fa;
    font-weight: 500;
    padding: 0.5rem 1rem;
    background: #eff6ff;
    border-radius: 8px;
}
/* Toggle Switch */
.facebook.toggle-container {
    display: flex;
    justify-content: center;
}
.facebook.toggle-wrapper {
    position: relative;
    display: flex;
    background: #e0e7ff;
    border-radius: 50px;
    padding: 0.3rem;
    width: 100%;
    max-width: 360px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.4s ease;
}
.facebook.toggle-wrapper:hover {
    box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.15);
}
.facebook.toggle-wrapper input[type="radio"] {
    display: none;
}
.facebook.toggle-label {
    flex: 1;
    text-align: center;
    padding: 0.8rem;
    font-size: 1rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    border-radius: 50px;
    transition: color 0.3s ease, transform 0.3s ease, border 0.3s ease;
    position: relative;
    overflow: hidden;
}
.facebook.toggle-label:hover {
    color: #3b82f6;
    transform: scale(1.05);
}
.facebook.toggle-wrapper input:checked + .facebook.toggle-label {
    color: #60a5fa;
    border: 2px solid #60a5fa;
}
.facebook.toggle-label::after {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}
.facebook.toggle-label:hover::after {
    opacity: 1;
}
/* Form Note and Buttons */
.facebook.form-note {
    display: block;
    color: #f59e0b;
    font-size: 0.9rem;
    margin: 1.5rem 0;
    font-weight: 500;
    text-align: center;
}
.facebook.button-group, .facebook.download-group {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
    visibility: visible !important;
    opacity: 1 !important;
}
.facebook.stButton {
    position: relative;
    background: linear-gradient(to right, #60a5fa, #3b82f6);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: pulse 2s infinite;
}
.facebook.stButton:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.5);
}
.facebook.stButton:active {
    transform: translateY(0);
    animation: none;
}
.facebook.stDownloadButton {
    position: relative;
    background: linear-gradient(to right, #34d399, #10b981);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: pulse 2s infinite;
}
.facebook.stDownloadButton:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(52, 211, 153, 0.5);
}
.facebook.stDownloadButton:active {
    transform: translateY(0);
    animation: none;
}
.facebook.button-text {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.facebook.button-spinner {
    display: none;
    width: 24px;
    height: 24px;
    border: 4px solid #ffffff;
    border-top: 4px solid transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.facebook.stButton.loading .facebook.button-text {
    display: none;
}
.facebook.stButton.loading .facebook.button-spinner {
    display: inline-block;
}
.facebook.stStopButton {
    position: relative;
    background: linear-gradient(to right, #ef4444, #f87171);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.facebook.stStopButton:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.5);
}
.facebook.stStopButton:active {
    transform: translateY(0);
}
/* Flash Messages */
.facebook.flash-container {
    margin-bottom: 2rem;
}
.facebook.alert {
    border-radius: 12px;
    padding: 1rem 1.5rem;
    font-size: 0.95rem;
    position: relative;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.facebook.alert-success {
    background: #ecfdf5;
    color: #065f46;
}
.facebook.alert-danger {
    background: #fef2f2;
    color: #991b1b;
}
.facebook.alert-warning {
    background: #fffbeb;
    color: #d97706;
}
/* DataFrame Styling */
.facebook.stDataFrame {
    margin: 2.5rem 0;
    overflow-x: auto;
    max-width: 100%;
    max-height: 500px;
    overflow-y: auto;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.15);
    background: #ffffff;
    visibility: visible !important;
    opacity: 1 !important;
}
.facebook.stDataFrame table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 2px solid #e0e7ff;
    font-size: 0.95rem;
}
.facebook.stDataFrame th {
    background: #f1f5f9;
    font-weight: 600;
    padding: 1.2rem;
    color: #3b82f6;
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom: 2px solid #e0e7ff;
}
.facebook.stDataFrame td {
    padding: 1.2rem;
    border-top: 1px solid #e0e7ff;
    word-break: break-word;
    max-width: 300px;
}
.facebook.stDataFrame tr:nth-child(even) {
    background: #f8fafc;
}
.facebook.stDataFrame tr:hover {
    background: #eff6ff;
    transition: background 0.3s ease;
}
.facebook.download-group {
    text-align: center;
    margin-top: 1.5rem;
}
/* Metrics Section */
.facebook.metrics-container {
    margin: 3rem 0;
    padding: 2rem;
    background: linear-gradient(135deg, #f8fafc, #eff6ff);
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.15);
}
.facebook.metrics-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 1.5rem;
}
.facebook.metrics-item {
    font-size: 1rem;
    color: #64748b;
    line-height: 1.6;
    margin: 0 0 1rem 0;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
    box-sizing: border-box;
}

.facebook.metrics-label {
    font-weight: 600;
    color: #60a5fa;
    display: inline-block;
    margin-right: 0.4rem;
    vertical-align: middle;
    white-space: nowrap;
}
/* Responsive Design */
@media (min-width: 768px) {
    .facebook.form-grid {
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 767px) {
    .facebook.main {
        padding: 1.5rem;
        margin: 1rem;
    }
    .facebook.stForm {
        padding: 1.5rem;
    }
    .facebook.header-title {
        font-size: 2rem;
    }
    .facebook.toggle-wrapper {
        max-width: 100%;
    }
    .facebook.button-group, .facebook.download-group {
        flex-direction: column;
        gap: 1rem;
    }
    .facebook.stButton, .facebook.stDownloadButton, .facebook.stStopButton {
        width: 100%;
        padding: 0.8rem;
    }
}
@media (max-width: 576px) {
    .facebook.stDataFrame table {
        font-size: 0.85rem;
    }
    .facebook.stDataFrame th, .facebook.stDataFrame td {
        padding: 0.8rem;
    }
}