/* Optional: Custom styles can go here or in a separate CSS file */
body {
  background-color: #121212 !important; /* Override Bootstrap dark theme if needed */
  color: #ffffff;
  padding-top: 70px; /* Adjust based on new header height */
}
.logo-placeholder { /* Placeholder for Transmission logo */
  width: 50px; /* Adjust as needed */
  height: 50px; /* Adjust as needed */
  background-color: #6c757d; /* Placeholder color */
  display: inline-block;
  margin-right: 15px;
  vertical-align: middle;
}
.header {
  background-color: #1e1e2e;
  padding: 15px;
  text-align: center;
  font-size: 24px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
  position: fixed; /* Make header fixed */
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030; /* Ensure header is above other content */
  color: #ffffff;
}
.header img {
  height: 40px;
  margin-right: 10px;
}
#connectionStatus {
  font-size: 0.8rem; /* Smaller text for connection status */
}
#connectionStatus .status-indicator {
  width: 12px; /* Smaller indicator */
  height: 12px;
}
#connectionStatus .connection-text {
    color: #ffffff; /* Ensure text is white */
}
.status-indicator {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
}
.status-connected {
  background-color: #198754; /* Bootstrap green */
}
.status-disconnected {
  background-color: #dc3545; /* Bootstrap red */
}
.status-pending {
  background-color: #ffc107; /* Bootstrap yellow */
}
.card-custom {
  background-color: #1e1e2e !important; /* Important to override Bootstrap potentially */
  color: white;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  /* max-height: 400px; /* Adjust height as needed, or remove for auto height */
  /* overflow-y: auto;  /* Enable scrolling if content exceeds max-height */
}
.card-custom .card-body {
  padding: 1rem; /* Standard Bootstrap card padding */
}

/* Make the torrent list table scrollable and responsive */
#torrent-list-section .card-custom .card-body .table-responsive {
  max-height: 400px; /* Adjust as needed */
  overflow-y: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Enhanced table responsive wrapper */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
}

.table-responsive::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.table-responsive::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: rgba(168, 85, 247, 0.3);
  border-radius: 3px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
  background: rgba(168, 85, 247, 0.5);
}

/* Ensure table text within card-custom is white */
.card-custom .table {
  color: #ffffff; /* For text in table cells */
}
.card-custom .table th,
.card-custom .table td {
  border-color: #333; /* Darker borders for table cells */
}
.card-custom .table-hover tbody tr:hover {
  background-color: #2a2a3a; /* Darker hover for table rows */
  color: #ffffff;
}

/* Style for list group items inside card-custom */
.card-custom .list-group-item {
    background-color: #2c2c3e; /* Darker background for list items */
    border-color: #333;
    color: #ffffff;
}


/* Styles from example for placeholders, adapt as needed */
.terminal-container {
  background-color: black;
  color: greenyellow;
  font-family: monospace;
  padding: 10px;
  height: 150px; /* Example height */
  overflow-y: auto;
  border-radius: 8px; /* Rounded corners for terminal */
  border: 1px solid #444;
}

.command-input-example { /* Renamed to avoid conflict if real terminal input is different */
  background-color: #222;
  color: #0f0;
  border: 1px solid #555;
  font-family: monospace;
}

.card-custom .form-control {
    background-color: #2c2c3e; /* Darker input fields */
    color: #ffffff;
    border: 1px solid #444;
}
.card-custom .form-control::placeholder {
    color: #aaa;
}
.card-custom .form-control:focus {
    background-color: #333;
    color: #ffffff;
    border-color: #555;
    box-shadow: none;
}
 /* Custom Dashboard Styles */
    :root {
      --primary-gradient: linear-gradient(135deg, #a855f7 0%, #8b5cf6 100%);
      --success-gradient: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
      --warning-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
      --info-gradient: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
      --danger-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
      --dark-gradient: linear-gradient(135deg, #13171d 0%, #0d1117 100%);
      --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
      --card-shadow-hover: 0 16px 48px rgba(0, 0, 0, 0.4);
      --border-radius: 16px;
      --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      --header-height: 60px;
    }

    body {
      background: linear-gradient(135deg, #2c1e3c 0%, #1a1125 100%);
      min-height: 100vh;
      font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
      margin: 0;
      padding: 0;
      color: rgba(255, 255, 255, 0.9);
    }

    .main-header {
      background: rgba(13, 17, 23, 0.95);
      backdrop-filter: blur(20px);
      border-bottom: 1px solid rgba(168, 85, 247, 0.2);
      box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
      height: var(--header-height);
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      z-index: 1000;
    }

    .dashboard-container {
      display: flex;
      margin-top: var(--header-height);
      height: calc(100vh - var(--header-height));
    }
    
    .dashboard-sidebar {
      width: 380px;
      height: calc(100vh - var(--header-height));
      background: rgba(13, 17, 23, 0.95);
      backdrop-filter: blur(20px);
      border-right: 1px solid rgba(255, 255, 255, 0.1);
      overflow-y: auto;
      flex-shrink: 0;
      box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
    }

    .dashboard-main {
      flex: 1;
      height: calc(100vh - var(--header-height));
      overflow-y: auto;
      background: rgba(255, 255, 255, 0.02);
    }

    .dashboard-header {
      background: rgba(13, 17, 23, 0.3);
      padding: 20px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .dashboard-content {
      padding: 20px;
    }
    
    .custom-card {
      background: rgba(13, 17, 23, 0.7);
      border: 1px solid rgba(168, 85, 247, 0.1);
      border-radius: var(--border-radius);
      box-shadow: var(--card-shadow);
      backdrop-filter: blur(10px);
      transition: var(--transition);
      overflow: hidden;
    }

    .custom-card:hover {
      transform: translateY(-4px);
      box-shadow: var(--card-shadow-hover);
      border-color: rgba(168, 85, 247, 0.3);
    }

    .torrent-card {
      position: relative;
    }

    .torrent-card::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 3px;
      background: var(--primary-gradient);
      border-radius: var(--border-radius) var(--border-radius) 0 0;
    }

    .torrent-card.updating {
      opacity: 0.8;
    }

    .card-header {
      background: rgba(255, 255, 255, 0.02);
      border-bottom: 1px solid rgba(255, 255, 255, 0.1);
      padding: 1rem;
    }

    .card-footer {
      background: rgba(255, 255, 255, 0.02);
      border-top: 1px solid rgba(255, 255, 255, 0.1);
      padding: 1rem;
    }

    .stats-card {
      background: rgba(13, 17, 23, 0.7);
      border: 1px solid rgba(168, 85, 247, 0.1);
      border-radius: var(--border-radius);
      transition: var(--transition);
      position: relative;
      overflow: hidden;
    }

    .stats-card:hover {
      transform: scale(1.02);
      box-shadow: 0 8px 24px rgba(168, 85, 247, 0.2);
      border-color: rgba(168, 85, 247, 0.3);
    }

    .stat-card::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 2px;
      background: var(--primary-gradient);
    }

    .stat-number {
      font-weight: 700;
      font-size: 1.5rem;
      color: white;
    }

    .stat-updating {
      animation: statPulse 0.5s ease-in-out;
    }

    @keyframes statPulse {
      0% { transform: scale(1); }
      50% { transform: scale(1.1); color: #ffffff; }
      100% { transform: scale(1); }
    }

    .counter-updating {
      animation: counterGlow 0.6s ease-in-out;
    }

    @keyframes counterGlow {
      0% { text-shadow: none; }
      50% { text-shadow: 0 0 20px #ffffff; }
      100% { text-shadow: none; }
    }

    .category-item {
      cursor: pointer;
      transition: var(--transition);
      border: 1px solid transparent;
      border-radius: var(--border-radius);
      position: relative;
      overflow: hidden;
    }
    
    .category-item:hover {
      background: rgba(168, 85, 247, 0.1);
      border-color: rgba(168, 85, 247, 0.3);
      transform: translateX(4px);
    }
    
    .category-item.active {
      background: var(--primary-gradient);
      border-color: rgba(168, 85, 247, 0.4);
      box-shadow: 0 4px 16px rgba(168, 85, 247, 0.2);
    }

    .activity-chart {
      height: 150px;
      background: rgba(255, 255, 255, 0.02);
      border-radius: var(--border-radius);
      padding: 0.5rem;
    }

    .custom-progress {
      height: 8px;
      background: rgba(255, 255, 255, 0.1);
      border-radius: 4px;
      overflow: hidden;
      position: relative;
    }

    .progress-bar {
      height: 100%;
      border-radius: 4px;
      transition: width 0.5s ease-in-out;
      position: relative;
      background: rgba(255, 255, 255, 0.4) !important;
    }

    .progress-text {
      font-size: 0.8rem;
      margin-top: 0.25rem;
      color: rgba(255, 255, 255, 0.7);
    }

    .speed-indicators {
      display: flex;
      gap: 1rem;
      margin: 0.5rem 0;
    }

    .speed-item {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      font-size: 0.9rem;
    }

    .speed-icon {
      width: 16px;
      text-align: center;
      color: rgba(255, 255, 255, 0.7);
    }

    .speed-update {
      animation: speedPulse 1s ease-in-out;
    }

    @keyframes speedPulse {
      0% { color: inherit; }
      50% { color: #ffffff; text-shadow: 0 0 8px #ffffff; }
      100% { color: inherit; }
    }

    .torrent-stats {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0.5rem;
      font-size: 0.85rem;
      margin-top: 0.5rem;
    }

    .stat-item {
      display: flex;
      justify-content: space-between;
    }

    .stat-label {
      color: rgba(255, 255, 255, 0.6);
    }

    /* Torrent details styling */
    .torrent-details {
      margin-top: 0.75rem;
      padding-top: 0.75rem;
      border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .detail-item {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      margin-bottom: 0.4rem;
      font-size: 0.75rem;
      line-height: 1.2;
    }

    .detail-item:last-child {
      margin-bottom: 0;
    }

    .detail-icon {
      width: 12px;
      font-size: 0.7rem;
      color: rgba(255, 255, 255, 0.5);
      flex-shrink: 0;
    }

    .detail-label {
      color: rgba(255, 255, 255, 0.6);
      font-weight: 500;
      min-width: 50px;
      flex-shrink: 0;
    }

    .detail-value {
      color: rgba(255, 255, 255, 0.8);
      font-size: 0.7rem;
      flex: 1;
      text-align: right;
    }

    .error-message {
      background: rgba(220, 53, 69, 0.1);
      color: #ff6b6b;
      padding: 0.5rem;
      border-radius: 8px;
      font-size: 0.85rem;
      margin-top: 0.5rem;
      border-left: 3px solid #ff6b6b;
    }

    .action-buttons {
      display: flex;
      gap: 0.5rem;
    }

    .btn-custom {
      flex: 1;
      padding: 0.5rem 1rem;
      border: none;
      border-radius: 8px;
      font-size: 0.85rem;
      font-weight: 500;
      transition: var(--transition);
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.5rem;
      position: relative;
      overflow: hidden;
      background: rgba(13, 17, 23, 0.8);
      color: rgba(255, 255, 255, 0.8);
      border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .btn-custom::before {
      content: '';
      position: absolute;
      top: 0;
      left: -100%;
      width: 100%;
      height: 100%;
      background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
      transition: left 0.5s;
    }

    .btn-custom:hover::before {
      left: 100%;
    }

    .btn-custom:hover {
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba(168, 85, 247, 0.2);
      background: rgba(168, 85, 247, 0.1);
      color: white;
      border-color: rgba(168, 85, 247, 0.3);
    }

    .btn-custom:disabled {
      opacity: 0.5;
      cursor: not-allowed;
      transform: none;
    }

    .btn-custom.btn-warning {
      background: rgba(245, 158, 11, 0.1);
      border-color: rgba(245, 158, 11, 0.3);
      color: #f59e0b;
    }

    .btn-custom.btn-warning:hover {
      background: rgba(245, 158, 11, 0.2);
      border-color: rgba(245, 158, 11, 0.5);
      color: white;
      box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
    }

    .btn-custom.btn-success {
      background: rgba(34, 197, 94, 0.1);
      border-color: rgba(34, 197, 94, 0.3);
      color: #22c55e;
    }

    .btn-custom.btn-success:hover {
      background: rgba(34, 197, 94, 0.2);
      border-color: rgba(34, 197, 94, 0.5);
      color: white;
      box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
    }

    .btn-custom.btn-danger {
      background: rgba(239, 68, 68, 0.1);
      border-color: rgba(239, 68, 68, 0.3);
      color: #ef4444;
    }

    .btn-custom.btn-danger:hover {
      background: rgba(239, 68, 68, 0.2);
      border-color: rgba(239, 68, 68, 0.5);
      color: white;
      box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
    }

    .btn-custom.btn-secondary {
      background: rgba(107, 114, 128, 0.1);
      border-color: rgba(107, 114, 128, 0.3);
      color: #6b7280;
    }

    .text-primary { color: #a855f7 !important; }
    .text-success { color: #22c55e !important; }
    .text-info { color: #3b82f6 !important; }
    .text-warning { color: #f59e0b !important; }
    .text-danger { color: #ef4444 !important; }

    .badge {
      background: rgba(168, 85, 247, 0.2) !important;
      color: white !important;
    }

    .size-info {
      font-weight: 500;
      color: rgba(255, 255, 255, 0.8);
      margin-bottom: 0.5rem;
    }

    .updating {
      opacity: 0.8;
      transition: opacity 0.3s ease;
    }

    /* Scrollbar Styling */
    .dashboard-sidebar::-webkit-scrollbar {
      width: 6px;
    }

    .dashboard-sidebar::-webkit-scrollbar-track {
      background: rgba(255, 255, 255, 0.05);
    }

    .dashboard-sidebar::-webkit-scrollbar-thumb {
      background: rgba(255, 255, 255, 0.2);
      border-radius: 3px;
    }

    .dashboard-sidebar::-webkit-scrollbar-thumb:hover {
      background: rgba(255, 255, 255, 0.3);
    }

    /* Docker Activity Log Styles */
    .log-entry {
      background: rgba(255, 255, 255, 0.02);
      border-radius: 8px;
      transition: all 0.2s ease;
    }
    
    .log-entry:hover {
      background: rgba(255, 255, 255, 0.05);
    }
    
    .log-header {
      font-size: 0.85rem;
      line-height: 1.3;
    }
    
    .log-message {
      font-size: 0.75rem;
      line-height: 1.2;
    }
    
    .log-timestamp {
      font-size: 0.7rem;
      min-width: 60px;
    }
    
    .status-badge .badge-sm {
      font-size: 0.6rem;
      padding: 0.2em 0.4em;
    }
    
    #dockerActivityLog::-webkit-scrollbar {
      width: 4px;
    }
    
    #dockerActivityLog::-webkit-scrollbar-track {
      background: rgba(255, 255, 255, 0.1);
      border-radius: 2px;
    }
    
    #dockerActivityLog::-webkit-scrollbar-thumb {
      background: rgba(168, 85, 247, 0.3);
      border-radius: 2px;
    }
    
    #dockerActivityLog::-webkit-scrollbar-thumb:hover {
      background: rgba(168, 85, 247, 0.5);
    }

    /* Mobile Responsive */
    @media (max-width: 768px) {
      .dashboard-container {
        flex-direction: column;
      }
      
      .dashboard-sidebar {
        width: 100%;
        height: auto;
        max-height: 150px;
        overflow-y: auto;
      }
      
      .dashboard-main {
        height: auto;
        min-height: calc(100vh - var(--header-height) - 150px);
      }

      /* Hide activity chart on mobile */
      .activity-chart {
        display: none;
      }

      /* Hide activity cards section on mobile */
      .dashboard-header {
        display: none;
      }

      /* Simplify sidebar sections on mobile */
      .sidebar-section {
        padding: 0.5rem !important;
      }

      .sidebar-section h6 {
        font-size: 0.75rem;
        margin-bottom: 0.25rem !important;
      }

      .category-item {
        padding: 0.4rem !important;
        margin-bottom: 0.25rem !important;
        font-size: 0.8rem;
      }

      .category-item .badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
      }

      .stat-card {
        padding: 0.4rem !important;
      }

      .stat-number {
        font-size: 1rem !important;
      }

      .torrent-stats {
        grid-template-columns: 1fr;
      }

      .action-buttons {
        flex-direction: column;
      }

      /* Hide VPN status and overview on mobile to save space */
      .mobile-hide {
        display: none;
      }

      /* Compact overview stats */
      .mobile-stats .row {
        --bs-gutter-x: 0.25rem;
      }

      .mobile-stats .stat-card {
        margin-bottom: 0.25rem;
      }

      /* Make torrent cards stack better on mobile */
      .col-lg-6, .col-xl-4 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
      }

      /* Reduce card padding on mobile */
      .custom-card .card-body {
        padding: 0.75rem !important;
      }

      .custom-card .card-header {
        padding: 0.5rem !important;
      }

      .custom-card .card-footer {
        padding: 0.5rem !important;
      }
    }

    /* Medium screen adjustments */
    @media (max-width: 1200px) and (min-width: 769px) {
      .dashboard-sidebar {
        width: 350px;
      }
    }

    /* Loading Animation */
    .loading-pulse {
      animation: pulse 2s infinite;
    }

    @keyframes pulse {
      0% { opacity: 1; }
      50% { opacity: 0.5; }
      100% { opacity: 1; }
    }

    /* Empty category styling */
    .empty-category {
      min-height: 300px;
      display: flex;
      align-items: center;
      justify-content: center;
      text-align: center;
      color: rgba(255, 255, 255, 0.6);
    }

    .empty-category-content i {
      font-size: 3rem;
      margin-bottom: 1rem;
      opacity: 0.5;
    }

    .empty-category-content h5 {
      color: rgba(255, 255, 255, 0.8);
      margin-bottom: 0.5rem;
    }

    .empty-category-content p {
      color: rgba(255, 255, 255, 0.5);
      font-size: 0.9rem;
    }

    /* Connection Status Styles */
    .status-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      animation: statusPulse 2s ease-in-out infinite;
    }

    .status-dot.bg-success {
      background-color: #22c55e !important;
      box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
    }

    .status-dot.bg-warning {
      background-color: #f59e0b !important;
      box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
    }

    .status-dot.bg-danger {
      background-color: #ef4444 !important;
      box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
    }

    @keyframes statusPulse {
      0%, 100% { opacity: 1; }
      50% { opacity: 0.7; }
    }

    /* New styles for action bar */
    .action-bar {
      background: rgba(13, 17, 23, 0.7);
      border-radius: var(--border-radius);
      box-shadow: var(--card-shadow);
      backdrop-filter: blur(10px);
      padding: 0.5rem 1rem;
      margin-bottom: 1rem;
    }

    .action-bar .btn-custom {
      flex: none;
      padding: 0.4rem 0.8rem;
      font-size: 0.8rem;
    }

    .action-bar .btn-custom i {
      font-size: 1.2rem;
    }

    /* Header button styling */
    .main-header .btn-custom {
      flex: none;
      padding: 0.375rem 0.75rem;
      font-size: 0.8rem;
      min-width: auto;
    }

    .main-header .btn-custom i {
      font-size: 0.9rem;
    }

    .action-bar .text-muted {
      color: rgba(255, 255, 255, 0.7) !important;
    }

    /* Circular Menu Styles */
    .circular-menu-container {
      position: relative;
      display: inline-block;
      margin-left: 8px;
      transition: all 0.3s ease;
    }

    /* Add background glow when menu is active */
    .circular-menu-container.active::before {
      content: '';
      position: absolute;
      top: 50%;
      left: 50%;
      width: 60px;
      height: 60px;
      background: radial-gradient(circle, rgba(168, 85, 247, 0.15) 0%, rgba(168, 85, 247, 0.05) 70%, transparent 100%);
      border-radius: 50%;
      transform: translate(-50%, -50%);
      z-index: 5;
      animation: menuGlow 0.3s ease-out;
    }

    @keyframes menuGlow {
      0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
      }
      100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
      }
    }

    .circular-menu-trigger {
      width: 28px;
      height: 28px;
      border-radius: 50%;
      background: rgba(168, 85, 247, 0.1);
      border: 1px solid rgba(168, 85, 247, 0.3);
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.3s ease;
      position: relative;
      z-index: 20;
    }

    .circular-menu-trigger i {
      font-size: 12px;
      color: rgba(255, 255, 255, 0.7);
      transition: all 0.3s ease;
    }

    .circular-menu-trigger:hover {
      background: rgba(168, 85, 247, 0.2);
      border-color: rgba(168, 85, 247, 0.5);
      transform: scale(1.1);
    }

    .circular-menu-trigger:hover i {
      color: rgba(168, 85, 247, 0.9);
      transform: rotate(90deg);
    }

    .circular-menu-trigger.active {
      background: rgba(168, 85, 247, 0.4);
      border-color: rgba(168, 85, 247, 0.8);
      transform: scale(1.15);
      box-shadow: 0 0 12px rgba(168, 85, 247, 0.4);
    }

    .circular-menu-trigger.active i {
      color: white;
      transform: rotate(180deg);
    }

    .circular-menu {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 80px;
      height: 80px;
      pointer-events: none;
      z-index: 15;
    }

    .menu-item {
      position: absolute;
      width: 32px;
      height: 32px;
      border-radius: 50%;
      background: rgba(13, 17, 23, 0.95);
      border: 1px solid rgba(168, 85, 247, 0.3);
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
      backdrop-filter: blur(10px);
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
      opacity: 0;
      transform: scale(0) translate(-50%, -50%);
      pointer-events: none;
    }

    .menu-item i {
      font-size: 12px;
      color: rgba(255, 255, 255, 0.8);
      transition: all 0.2s ease;
    }

    .circular-menu.active .menu-item {
      opacity: 1;
      transform: scale(1);
      pointer-events: all;
    }

    .menu-item-1 {
      top: -20px;
      left: 50%;
      transform: translateX(-50%) translateY(-100%) scale(0);
    }

    .circular-menu.active .menu-item-1 {
      transform: translateX(-50%) translateY(-100%) scale(1);
      transition-delay: 0.1s;
    }

    .menu-item-2 {
      bottom: -20px;
      left: 50%;
      transform: translateX(-50%) translateY(100%) scale(0);
    }

    .circular-menu.active .menu-item-2 {
      transform: translateX(-50%) translateY(100%) scale(1);
      transition-delay: 0.2s;
    }

    .menu-item:hover:not(.disabled) {
      background: rgba(168, 85, 247, 0.2);
      border-color: rgba(168, 85, 247, 0.5);
      transform: scale(1.1);
      box-shadow: 0 6px 24px rgba(168, 85, 247, 0.3);
    }

    .menu-item:hover:not(.disabled) i {
      color: white;
      transform: scale(1.2);
    }

    /* Special styling for remove button */
    .menu-item-2:hover:not(.disabled) {
      background: rgba(239, 68, 68, 0.2);
      border-color: rgba(239, 68, 68, 0.5);
      box-shadow: 0 6px 24px rgba(239, 68, 68, 0.3);
    }

    .menu-item-2:hover:not(.disabled) i {
      color: #ef4444;
    }

    .menu-item.disabled {
      opacity: 0.5;
      cursor: not-allowed;
      background: rgba(13, 17, 23, 0.7);
      border-color: rgba(255, 255, 255, 0.1);
    }

    .menu-item.disabled i {
      color: rgba(255, 255, 255, 0.4);
    }

    /* Ensure menus don't interfere with each other */
    .circular-menu-container {
      z-index: 10;
    }

    .circular-menu-container.active {
      z-index: 30;
    }

    /* Toast Notification System */
    .toast-container {
      position: fixed;
      bottom: 20px;
      left: 20px;
      z-index: 9999;
      max-width: 400px;
      pointer-events: none;
    }

    .custom-toast {
      background: rgba(13, 17, 23, 0.95);
      border: 1px solid;
      border-radius: 12px;
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
      backdrop-filter: blur(20px);
      margin-bottom: 12px;
      padding: 16px 20px;
      min-height: 60px;
      display: flex;
      align-items: center;
      gap: 12px;
      opacity: 0;
      transform: translateX(-100%);
      transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
      pointer-events: auto;
      position: relative;
      overflow: hidden;
    }

    .custom-toast::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 3px;
      background: var(--toast-accent-color);
      border-radius: 12px 12px 0 0;
    }

    .custom-toast.show {
      opacity: 1;
      transform: translateX(0);
    }

    .custom-toast.hide {
      opacity: 0;
      transform: translateX(-100%);
      margin-bottom: 0;
      padding-top: 0;
      padding-bottom: 0;
      min-height: 0;
    }

    /* Toast Types */
    .custom-toast.success {
      border-color: rgba(34, 197, 94, 0.3);
      --toast-accent-color: #22c55e;
    }

    .custom-toast.error {
      border-color: rgba(239, 68, 68, 0.3);
      --toast-accent-color: #ef4444;
    }

    .custom-toast.warning {
      border-color: rgba(245, 158, 11, 0.3);
      --toast-accent-color: #f59e0b;
    }

    .custom-toast.info {
      border-color: rgba(59, 130, 246, 0.3);
      --toast-accent-color: #3b82f6;
    }

    .toast-icon {
      width: 24px;
      height: 24px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      font-size: 12px;
      font-weight: bold;
    }

    .custom-toast.success .toast-icon {
      background: rgba(34, 197, 94, 0.2);
      color: #22c55e;
      border: 1px solid rgba(34, 197, 94, 0.3);
    }

    .custom-toast.error .toast-icon {
      background: rgba(239, 68, 68, 0.2);
      color: #ef4444;
      border: 1px solid rgba(239, 68, 68, 0.3);
    }

    .custom-toast.warning .toast-icon {
      background: rgba(245, 158, 11, 0.2);
      color: #f59e0b;
      border: 1px solid rgba(245, 158, 11, 0.3);
    }

    .custom-toast.info .toast-icon {
      background: rgba(59, 130, 246, 0.2);
      color: #3b82f6;
      border: 1px solid rgba(59, 130, 246, 0.3);
    }

    .toast-content {
      flex: 1;
      color: rgba(255, 255, 255, 0.9);
    }

    .toast-title {
      font-weight: 600;
      font-size: 14px;
      margin-bottom: 2px;
      line-height: 1.2;
    }

    .toast-message {
      font-size: 13px;
      color: rgba(255, 255, 255, 0.7);
      line-height: 1.3;
    }

    .toast-close {
      width: 20px;
      height: 20px;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.1);
      border: none;
      color: rgba(255, 255, 255, 0.6);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 12px;
      transition: all 0.2s ease;
      flex-shrink: 0;
    }

    .toast-close:hover {
      background: rgba(255, 255, 255, 0.2);
      color: rgba(255, 255, 255, 0.9);
      transform: scale(1.1);
    }

    /* Progress bar for auto-dismiss */
    .toast-progress {
      position: absolute;
      bottom: 0;
      left: 0;
      height: 2px;
      background: var(--toast-accent-color);
      border-radius: 0 0 12px 12px;
      transition: width linear;
      opacity: 0.6;
    }

    /* Mobile adjustments */
    @media (max-width: 768px) {
      .toast-container {
        left: 10px;
        right: 10px;
        max-width: none;
      }

      .custom-toast {
        padding: 12px 16px;
        min-height: 50px;
      }

      .toast-title {
        font-size: 13px;
      }

      .toast-message {
        font-size: 12px;
      }
    }

    /* Stacking animation */
    .custom-toast:not(:last-child) {
      transform-origin: bottom center;
    }

    .toast-container:hover .custom-toast:not(:hover) {
      opacity: 0.7;
      transform: translateX(0) scale(0.95);
    }

    /* Cron Job Modal Styling */
    #dockerComposeContent {
    font-family: 'Courier New', Monaco, monospace;
    font-size: 13px;
    line-height: 1.4;
    resize: vertical;
    min-height: 300px;
}

.template-buttons .btn {
    margin: 2px;
}

#previewPath {
    word-break: break-all;
    background: rgba(13, 17, 23, 0.5);
    padding: 8px;
    border-radius: 4px;
    border: 1px solid rgba(168, 85, 247, 0.1);
}

/* Docker container creation button */
.create-docker-btn {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border: none;
    color: white;
    transition: all 0.3s ease;
}

.create-docker-btn:hover {
    background: linear-gradient(135deg, #16a34a, #15803d);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

/* Cron Job Modal Styling */
.job-config {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.job-config .form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.job-config .form-text {
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

#createCronJobModal .btn-check:checked + .btn-outline-info {
    background-color: #0dcaf0;
    border-color: #0dcaf0;
    color: #000;
}

#createCronJobModal .btn-outline-info {
    border-color: #0dcaf0;
    color: #0dcaf0;
}

#createCronJobModal .btn-outline-info:hover {
    background-color: rgba(13, 202, 240, 0.1);
    border-color: #0dcaf0;
    color: #0dcaf0;
}

/* Cron Job Logs Styling */
.logs-container {
    max-height: 70vh;
    overflow-y: auto;
    padding: 10px;
}

.log-entry {
    background: rgba(13, 17, 23, 0.3);
    border-radius: 8px;
    margin-bottom: 15px;
    transition: all 0.2s ease;
}

.log-entry:hover {
    background: rgba(13, 17, 23, 0.5);
    transform: translateY(-1px);
}

.log-entry .log-header h6 {
    color: #fff;
    margin-bottom: 5px;
}

.log-entry .log-times {
    font-size: 0.85rem;
    color: #6c757d;
}

.log-entry .log-output pre,
.log-entry .log-error pre {
    font-size: 0.8rem;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.log-entry .log-stats .card {
    background: rgba(33, 37, 41, 0.8) !important;
}

.log-entry .badge {
    font-size: 0.7rem;
    padding: 0.25em 0.5em;
}

/* Edit Cron Job Modal Styling */
#editCronJobModal .job-config {
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
    background: rgba(13, 17, 23, 0.3);
}

#editCronJobModal .alert {
    margin-bottom: 15px;
    padding: 10px 15px;
    font-size: 0.9rem;
}

#editCronJobModal .alert .fas {
    margin-right: 8px;
}

/* Responsive improvements for mobile */
@media (max-width: 768px) {
    .logs-container {
        max-height: 60vh;
        padding: 5px;
    }
    
    .log-entry {
        margin-bottom: 10px;
    }
    
    .log-entry .row {
        flex-direction: column;
    }
    
    .log-entry .col-md-4 {
        margin-top: 10px;
    }
}

/* Torrent Icon Toolbar Styles */
.torrent-toolbar {
    display: flex;
    justify-content: flex-end;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.torrent-card:hover .torrent-toolbar {
    opacity: 1;
}

.toolbar-icons {
    display: flex;
    gap: 4px;
}

.toolbar-icon-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.25s ease;
    cursor: pointer;
    outline: none;
}

.toolbar-icon-btn:hover {
    background: rgba(168, 85, 247, 0.3);
    color: #ffffff;
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.2);
}

.toolbar-icon-btn:active {
    transform: translateY(0) scale(0.98);
}

.toolbar-icon-btn:focus {
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.4);
}

/* Move Torrent Modal Styles */
#moveTorrentModal .modal-content {
    border: 2px solid rgba(168, 85, 247, 0.3);
}

#moveTorrentModal .modal-header {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(59, 130, 246, 0.1));
    border-bottom: 1px solid rgba(168, 85, 247, 0.3);
}

#moveTorrentModal .form-control:focus {
    border-color: #a855f7;
    box-shadow: 0 0 0 0.2rem rgba(168, 85, 247, 0.25);
}

#moveTorrentModal #confirmMoveBtn {
    background: linear-gradient(135deg, #a855f7, #3b82f6);
    border: none;
    transition: all 0.3s ease;
}

#moveTorrentModal #confirmMoveBtn:hover {
    background: linear-gradient(135deg, #9333ea, #2563eb);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

/* Password Change Form Styles */
#changePasswordForm {
    position: relative;
}

#changePasswordForm .card {
    border: 2px solid rgba(168, 85, 247, 0.2);
    background: rgba(168, 85, 247, 0.02);
    transition: all 0.3s ease;
}

#changePasswordForm .card:hover {
    border-color: rgba(168, 85, 247, 0.4);
    background: rgba(168, 85, 247, 0.05);
}

#changePasswordForm .form-control {
    background: rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    transition: all 0.3s ease;
}

#changePasswordForm .form-control:focus {
    background: rgba(0, 0, 0, 0.2);
    border-color: #a855f7;
    box-shadow: 0 0 0 0.2rem rgba(168, 85, 247, 0.25);
    color: #ffffff;
}

#changePasswordForm .form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

#changePasswordForm .form-label {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

#changePasswordForm .form-text {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
}

/* Password strength indicator */
.password-strength {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.password-strength-weak {
    background: linear-gradient(90deg, #dc3545, #e74c3c);
    width: 33%;
}

.password-strength-medium {
    background: linear-gradient(90deg, #ffc107, #f39c12);
    width: 66%;
}

.password-strength-strong {
    background: linear-gradient(90deg, #198754, #27ae60);
    width: 100%;
}

/* Success/Error message styling for password form */
#passwordMsg.text-success {
    color: #10b981 !important;
    background: rgba(16, 185, 129, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

#passwordMsg.text-danger {
    color: #a855f7 !important;
    background: rgba(168, 85, 247, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

/* Logout Button Styles - Updated to match site theme */
.btn-logout {
    background: linear-gradient(135deg, #a855f7, #8b5cf6) !important;
    border: 1px solid rgba(168, 85, 247, 0.3) !important;
    color: white !important;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-logout::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-logout:hover::before {
    left: 100%;
}

.btn-logout:hover {
    background: linear-gradient(135deg, #9333ea, #7c3aed) !important;
    border-color: rgba(168, 85, 247, 0.5) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
    color: white !important;
}

.btn-logout:active {
    transform: translateY(0);
}

.btn-logout:focus {
    box-shadow: 0 0 0 0.2rem rgba(168, 85, 247, 0.25);
    color: white !important;
}

/* Standardized Button Styles */
.btn-custom {
    background: linear-gradient(135deg, #a855f7, #8b5cf6);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: white;
    padding: 0.5rem 1rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.btn-custom::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-custom:hover::before {
    left: 100%;
}

.btn-custom:hover {
    background: linear-gradient(135deg, #9333ea, #7c3aed);
    border-color: rgba(168, 85, 247, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.3);
    color: white;
    text-decoration: none;
}

.btn-custom:active {
    transform: translateY(0);
}

.btn-custom:focus {
    box-shadow: 0 0 0 0.2rem rgba(168, 85, 247, 0.25);
    color: white;
    outline: none;
}

.btn-custom:disabled {
    background: rgba(108, 117, 125, 0.5);
    border-color: rgba(108, 117, 125, 0.3);
    color: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-custom:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Small button variant */
.btn-custom.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 6px;
}

/* Override Bootstrap button styles to match our theme */
.btn-danger {
    background: linear-gradient(135deg, #a855f7, #8b5cf6) !important;
    border: 1px solid rgba(168, 85, 247, 0.3) !important;
    color: white !important;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-danger::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-danger:hover::before {
    left: 100%;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #9333ea, #7c3aed) !important;
    border-color: rgba(168, 85, 247, 0.5) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.3);
    color: white !important;
}

.btn-danger:active {
    transform: translateY(0);
}

.btn-danger:focus {
    box-shadow: 0 0 0 0.2rem rgba(168, 85, 247, 0.25);
    color: white !important;
}

/* Warning buttons */
.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
    color: white !important;
    transition: all 0.3s ease;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d97706, #b45309) !important;
    border-color: rgba(245, 158, 11, 0.5) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.3);
    color: white !important;
}

/* Success buttons */
.btn-success {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
    color: white !important;
    transition: all 0.3s ease;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669, #047857) !important;
    border-color: rgba(16, 185, 129, 0.5) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
    color: white !important;
}

/* Info buttons */
.btn-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    color: white !important;
    transition: all 0.3s ease;
}

.btn-info:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
    border-color: rgba(59, 130, 246, 0.5) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3);
    color: white !important;
}

/* Secondary buttons */
.btn-secondary {
    background: linear-gradient(135deg, #6b7280, #4b5563) !important;
    border: 1px solid rgba(107, 114, 128, 0.3) !important;
    color: white !important;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #4b5563, #374151) !important;
    border-color: rgba(107, 114, 128, 0.5) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(107, 114, 128, 0.3);
    color: white !important;
}

/* Primary buttons */
.btn-primary {
    background: linear-gradient(135deg, #a855f7, #8b5cf6) !important;
    border: 1px solid rgba(168, 85, 247, 0.3) !important;
    color: white !important;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #9333ea, #7c3aed) !important;
    border-color: rgba(168, 85, 247, 0.5) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.3);
    color: white !important;
}

/* ================================================
   CUSTOM MODAL SYSTEM STYLES
   ================================================ */

/* Modal backdrop enhancement */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.7) !important;
    backdrop-filter: blur(5px);
}

/* Custom Modal Content */
.modal-content {
    background: linear-gradient(145deg, #1e1e2e, #252540) !important;
    border: 1px solid rgba(168, 85, 247, 0.2) !important;
    border-radius: 15px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 
                0 0 30px rgba(168, 85, 247, 0.1) !important;
    animation: modalSlideIn 0.3s ease-out;
}

/* Modal slide-in animation */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal Header Enhancement */
.modal-header {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(139, 92, 246, 0.05)) !important;
    border-bottom: 1px solid rgba(168, 85, 247, 0.2) !important;
    border-radius: 15px 15px 0 0 !important;
    padding: 1.5rem !important;
}

.modal-title {
    font-weight: 600 !important;
    font-size: 1.3rem !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.modal-title i {
    filter: drop-shadow(0 2px 4px rgba(168, 85, 247, 0.5));
}

/* Modal Body Enhancement */
.modal-body {
    padding: 2rem !important;
    color: #e5e7eb !important;
    font-size: 1.05rem !important;
    line-height: 1.6;
}

/* Modal Footer Enhancement */
.modal-footer {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.05), rgba(139, 92, 246, 0.02)) !important;
    border-top: 1px solid rgba(168, 85, 247, 0.2) !important;
    border-radius: 0 0 15px 15px !important;
    padding: 1.5rem !important;
    gap: 1rem;
}

/* Close Button Enhancement */
.btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.7 !important;
    transition: all 0.3s ease;
}

.btn-close:hover {
    opacity: 1 !important;
    transform: scale(1.1);
}

/* Custom Modal Icon Styling */
.modal-body .flex-shrink-0 i {
    text-shadow: 0 0 15px currentColor;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Success Modal Specific Styling */
#customSuccessModal .modal-content {
    border-color: rgba(34, 197, 94, 0.3) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 
                0 0 30px rgba(34, 197, 94, 0.15) !important;
}

#customSuccessModal .modal-header {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(34, 197, 94, 0.05)) !important;
    border-bottom-color: rgba(34, 197, 94, 0.2) !important;
}

#customSuccessModal .modal-footer {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.05), rgba(34, 197, 94, 0.02)) !important;
    border-top-color: rgba(34, 197, 94, 0.2) !important;
}

/* Error Modal Specific Styling */
#customErrorModal .modal-content {
    border-color: rgba(239, 68, 68, 0.3) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 
                0 0 30px rgba(239, 68, 68, 0.15) !important;
}

#customErrorModal .modal-header {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05)) !important;
    border-bottom-color: rgba(239, 68, 68, 0.2) !important;
}

#customErrorModal .modal-footer {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05), rgba(239, 68, 68, 0.02)) !important;
    border-top-color: rgba(239, 68, 68, 0.2) !important;
}

/* Confirm Modal Specific Styling */
#customConfirmModal .modal-content {
    border-color: rgba(245, 158, 11, 0.3) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 
                0 0 30px rgba(245, 158, 11, 0.15) !important;
}

#customConfirmModal .modal-header {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.05)) !important;
    border-bottom-color: rgba(245, 158, 11, 0.2) !important;
}

#customConfirmModal .modal-footer {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05), rgba(245, 158, 11, 0.02)) !important;
    border-top-color: rgba(245, 158, 11, 0.2) !important;
}

/* Loading Modal Specific Styling */
#loadingModal .modal-content {
    border-color: rgba(59, 130, 246, 0.3) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 
                0 0 30px rgba(59, 130, 246, 0.15) !important;
}

#loadingModal .modal-header {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.05)) !important;
    border-bottom-color: rgba(59, 130, 246, 0.2) !important;
}

/* Loading spinner enhancement */
.spinner-border {
    filter: drop-shadow(0 2px 8px rgba(59, 130, 246, 0.5));
}

/* Button hover effects in modals */
.modal-footer .btn-custom:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(168, 85, 247, 0.3) !important;
}

.modal-footer .btn-danger:hover {
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3) !important;
}

.modal-footer .btn-success:hover {
    box-shadow: 0 8px 25px rgba(34, 197, 94, 0.3) !important;
}

.modal-footer .btn-warning:hover {
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.3) !important;
}

/* Modal dialog centering enhancement */
.modal-dialog-centered {
    min-height: calc(100vh - 3rem);
}

/* Responsive modal adjustments */
@media (max-width: 576px) {
    .modal-content {
        border-radius: 10px !important;
        margin: 0.5rem;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem !important;
    }
    
    .modal-title {
        font-size: 1.1rem !important;
    }
    
    .modal-body {
        font-size: 1rem !important;
    }
}

/* View Toggle Buttons */
.view-toggle-btn {
    background: rgba(13, 17, 23, 0.8) !important;
    border: 1px solid rgba(168, 85, 247, 0.3) !important;
    color: rgba(255, 255, 255, 0.7) !important;
    transition: all 0.3s ease !important;
    min-width: 45px;
    padding: 0.375rem 0.75rem !important;
}

.view-toggle-btn:hover {
    background: rgba(168, 85, 247, 0.2) !important;
    border-color: rgba(168, 85, 247, 0.5) !important;
    color: white !important;
    transform: translateY(-1px);
}

.view-toggle-btn.active {
    background: linear-gradient(135deg, #a855f7 0%, #3b82f6 100%) !important;
    border-color: #a855f7 !important;
    color: white !important;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3) !important;
}

.view-toggle-btn.active:hover {
    background: linear-gradient(135deg, #9333ea 0%, #2563eb 100%) !important;
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4) !important;
}

/* Mobile responsive for view toggles */
@media (max-width: 576px) {
    .action-bar .d-flex {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    
    #viewToggleButtons {
        align-self: center;
    }
    
    .view-toggle-btn {
        min-width: 40px;
        padding: 0.3rem 0.6rem !important;
    }
}

/* Table View Styles */
.content-table {
    background: rgba(13, 17, 23, 0.8);
    border: 1px solid rgba(168, 85, 247, 0.1);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.content-table .table {
    margin-bottom: 0;
    color: white;
}

.content-table .table th {
    background: linear-gradient(135deg, #a855f7 0%, #3b82f6 100%);
    color: white;
    border: none;
    padding: 1rem 0.75rem;
    font-weight: 600;
    font-size: 0.9rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.content-table .table td {
    background: rgba(13, 17, 23, 0.4);
    border-color: rgba(168, 85, 247, 0.1);
    padding: 0.75rem;
    vertical-align: middle;
}

.content-table .table tbody tr {
    transition: all 0.3s ease;
}

.content-table .table tbody tr:hover {
    background: rgba(168, 85, 247, 0.1) !important;
    transform: translateX(2px);
}

.table-name-cell {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-name-cell .table-name-text {
    font-weight: 600;
    color: white;
}

.table-progress-cell {
    min-width: 120px;
}

.table-progress-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.table-progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.table-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.table-progress-text {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    min-width: 45px;
    text-align: right;
}

.table-size-cell,
.table-speed-cell {
    text-align: right;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.table-speed-container {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.table-speed-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    justify-content: flex-end;
}

.table-speed-icon {
    font-size: 0.75rem;
    width: 12px;
}

.table-actions-cell {
    min-width: 120px;
}

.table-action-buttons {
    display: flex;
    gap: 0.3rem;
    justify-content: center;
}

.table-action-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(168, 85, 247, 0.2);
    color: white;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.table-action-btn:hover {
    background: rgba(168, 85, 247, 0.4);
    transform: translateY(-1px);
}

.table-action-btn.btn-success {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.3);
}

.table-action-btn.btn-success:hover {
    background: rgba(16, 185, 129, 0.4);
}

.table-action-btn.btn-warning {
    background: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.3);
}

.table-action-btn.btn-warning:hover {
    background: rgba(245, 158, 11, 0.4);
}

.table-action-btn.btn-danger {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
}

.table-action-btn.btn-danger:hover {
    background: rgba(239, 68, 68, 0.4);
}

.table-status-cell {
    text-align: center;
}

.table-status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
    display: inline-block;
    cursor: help;
}

.table-status-badge.downloading {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.table-status-badge.seeding {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.table-status-badge.paused {
    background: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.3);
}

.table-status-badge.error {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.table-status-badge.queued {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.table-status-badge.checking {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Table responsive enhancements */
@media (max-width: 1200px) {
    .content-table .table th,
    .content-table .table td {
        padding: 0.5rem 0.25rem;
        font-size: 0.85rem;
    }
    
    .table-name-cell {
        max-width: 200px;
    }
    
    .table-action-buttons {
        gap: 0.2rem;
    }
    
    .table-action-btn {
        font-size: 0.7rem;
        padding: 0.25rem 0.4rem;
    }
}

@media (max-width: 992px) {
    .content-table {
        border-radius: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .content-table .table {
        min-width: 800px; /* Ensure table doesn't get too cramped */
    }
    
    .content-table .table th,
    .content-table .table td {
        padding: 0.5rem 0.3rem;
        white-space: nowrap;
    }
    
    .table-name-cell {
        max-width: 180px;
        min-width: 150px;
    }
    
    .table-progress-container {
        min-width: 100px;
    }
    
    .table-speed-container {
        min-width: 80px;
    }
}

@media (max-width: 768px) {
    .content-table {
        font-size: 0.8rem;
        border-radius: 6px;
        margin-bottom: 0.5rem;
    }
    
    .content-table .table {
        min-width: 700px; /* Minimum width for horizontal scroll */
    }
    
    .content-table .table th,
    .content-table .table td {
        padding: 0.4rem 0.25rem;
        font-size: 0.75rem;
    }
    
    .table-name-cell {
        max-width: 120px;
        min-width: 100px;
    }
    
    .table-name-cell .table-name-text {
        font-size: 0.8rem;
    }
    
    .table-progress-container {
        min-width: 80px;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .table-progress-bar {
        width: 100%;
        height: 6px;
    }
    
    .table-progress-text {
        font-size: 0.7rem;
        min-width: auto;
        text-align: left;
    }
    
    .table-speed-container {
        min-width: 70px;
        gap: 0.2rem;
    }
    
    .table-speed-item {
        font-size: 0.7rem;
        gap: 0.2rem;
    }
    
    .table-speed-icon {
        font-size: 0.6rem;
        width: 10px;
    }
    
    .table-action-buttons {
        flex-direction: column;
        gap: 0.15rem;
        min-width: 60px;
    }
    
    .table-action-btn {
        font-size: 0.65rem;
        padding: 0.15rem 0.3rem;
        min-width: 35px;
    }
    
    .table-action-btn i {
        font-size: 0.7rem;
    }
    
    .table-status-badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
        max-width: 80px;
    }
    
    .table-size-cell,
    .table-speed-cell {
        font-size: 0.7rem;
    }
}

@media (max-width: 576px) {
    .content-table {
        border-radius: 4px;
        font-size: 0.75rem;
    }
    
    .content-table .table {
        min-width: 600px; /* Compact minimum width for small screens */
    }
    
    .content-table .table th {
        padding: 0.3rem 0.2rem;
        font-size: 0.7rem;
        font-weight: 500;
    }
    
    .content-table .table td {
        padding: 0.3rem 0.2rem;
        font-size: 0.7rem;
    }
    
    .table-name-cell {
        max-width: 100px;
        min-width: 80px;
    }
    
    .table-name-cell .table-name-text {
        font-size: 0.7rem;
        line-height: 1.2;
    }
    
    .table-name-cell i {
        font-size: 0.6rem;
        margin-right: 0.25rem;
    }
    
    .table-progress-container {
        min-width: 60px;
    }
    
    .table-progress-bar {
        height: 4px;
    }
    
    .table-progress-text {
        font-size: 0.65rem;
    }
    
    .table-speed-container {
        min-width: 55px;
    }
    
    .table-speed-item {
        font-size: 0.65rem;
    }
    
    .table-speed-icon {
        font-size: 0.55rem;
        width: 8px;
    }
    
    .table-action-buttons {
        min-width: 45px;
    }
    
    .table-action-btn {
        font-size: 0.6rem;
        padding: 0.1rem 0.25rem;
        min-width: 30px;
        border-radius: 3px;
    }
    
    .table-action-btn i {
        font-size: 0.65rem;
    }
    
    .table-status-badge {
        font-size: 0.6rem;
        padding: 0.15rem 0.4rem;
        max-width: 60px;
        letter-spacing: 0.2px;
    }
    
    .table-size-cell,
    .table-speed-cell {
        font-size: 0.65rem;
    }
}

/* Enhanced table wrapper for better mobile scrolling */
.table-responsive-custom {
    position: relative;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--border-radius);
}

.table-responsive-custom::-webkit-scrollbar {
    height: 8px;
}

.table-responsive-custom::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.table-responsive-custom::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.3);
    border-radius: 4px;
}

.table-responsive-custom::-webkit-scrollbar-thumb:hover {
    background: rgba(168, 85, 247, 0.5);
}

/* Table loading state */
.content-table.loading {
    opacity: 0.7;
    pointer-events: none;
}

.content-table.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(168, 85, 247, 0.3);
    border-top: 2px solid #a855f7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Mobile-first table alternative - card layout for very small screens */
@media (max-width: 480px) {
    .table-mobile-cards {
        display: none; /* Will be toggled via JavaScript */
    }
    
    .table-mobile-cards .mobile-torrent-card {
        background: rgba(13, 17, 23, 0.8);
        border: 1px solid rgba(168, 85, 247, 0.1);
        border-radius: 8px;
        padding: 0.75rem;
        margin-bottom: 0.5rem;
        transition: all 0.3s ease;
    }
    
    .table-mobile-cards .mobile-torrent-card:hover {
        background: rgba(168, 85, 247, 0.1);
        border-color: rgba(168, 85, 247, 0.3);
    }
    
    .mobile-card-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 0.5rem;
    }
    
    .mobile-card-title {
        font-weight: 600;
        font-size: 0.85rem;
        color: white;
        flex: 1;
        margin-right: 0.5rem;
        line-height: 1.3;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
    }
    
    .mobile-card-status {
        flex-shrink: 0;
    }
    
    .mobile-card-body {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.25rem 0.5rem;
        font-size: 0.75rem;
        margin-bottom: 0.5rem;
    }
    
    .mobile-card-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .mobile-card-label {
        color: rgba(255, 255, 255, 0.7);
        font-weight: 500;
    }
    
    .mobile-card-value {
        color: white;
        text-align: right;
    }
    
    .mobile-card-progress {
        grid-column: 1 / -1;
        margin: 0.25rem 0;
    }
    
    .mobile-card-actions {
        display: flex;
        gap: 0.25rem;
        justify-content: flex-end;
    }
    
    .mobile-action-btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
        border-radius: 4px;
        border: none;
        cursor: pointer;
        transition: all 0.2s ease;
        background: rgba(168, 85, 247, 0.2);
        color: white;
        border: 1px solid rgba(168, 85, 247, 0.3);
    }
    
    .mobile-action-btn:hover {
        background: rgba(168, 85, 247, 0.4);
    }
    
    /* Hide regular table on very small screens if mobile cards are enabled */
    .content-table.hide-on-mobile {
        display: none;
    }
}

/* ========================================
   CRON JOB TEMPLATE STYLES
   ======================================== */

.template-card {
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    background: rgba(0, 0, 0, 0.2);
}

.template-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    border-color: rgba(168, 85, 247, 0.5);
}

.template-icon {
    width: 60px;
    height: 60px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.template-card:hover .template-icon {
    transform: scale(1.1);
}

.template-card .card-title {
    color: #ffffff;
    font-weight: 600;
}

.template-card .card-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    line-height: 1.4;
}

.template-card .small {
    font-size: 0.75rem;
}

.template-card .small .text-muted {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* Template configuration form styles */
#cronJobTemplateConfigModal .form-check {
    background: rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

#cronJobTemplateConfigModal .form-check:hover {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(168, 85, 247, 0.3);
}

#cronJobTemplateConfigModal .form-check-input:checked ~ .form-check-label {
    color: #ffffff;
}

#cronJobTemplateConfigModal .form-check-input:checked {
    background-color: #a855f7;
    border-color: #a855f7;
}

#cronJobTemplateConfigModal .form-check-label strong {
    color: #ffffff;
    display: block;
    margin-bottom: 4px;
}

#cronJobTemplateConfigModal .form-check-label .text-muted {
    color: rgba(255, 255, 255, 0.6) !important;
    font-family: monospace;
    font-size: 0.8rem;
}

#cronJobTemplateConfigModal .form-control:focus {
    border-color: #a855f7;
    box-shadow: 0 0 0 0.2rem rgba(168, 85, 247, 0.25);
}

#cronJobTemplateConfigModal .form-select:focus {
    border-color: #a855f7;
    box-shadow: 0 0 0 0.2rem rgba(168, 85, 247, 0.25);
}

/* ─── Torrent Labels ──────────────────────────────────────────────────────── */
.torrent-labels { min-height: 1.4rem; }
.label-badge    { font-size: 0.7rem; vertical-align: middle; }
.label-chip     { font-size: 0.75rem; transition: opacity .15s; }
.label-chip:hover { opacity: .75; }
.min-height-chips { min-height: 2.5rem; }

/* Radarr / Sonarr import modal */
.arr-logo-sm            { vertical-align: middle; border-radius: 2px; }
.arr-poster             { width: 50px; height: 75px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.arr-poster-placeholder { width: 50px; height: 75px; display: flex; align-items: center; justify-content: center; background: #2d2d2d; border-radius: 4px; flex-shrink: 0; }
.arr-result-item        { transition: background .15s; }
.arr-result-item:hover  { background: rgba(255,255,255,.05); }