:root {
    --primary-color: #2563eb;
    --secondary-color: #0ea5e9;
    --warning-color: #f59e0b;
    --danger-color: #dc2626;
    --success-color: #16a34a;
    --light-bg: #f1f5f9;
    --border-color: #e2e8f0;
  }
  
  body { 
    background: var(--light-bg); 
    padding: 40px;
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  }
  
  .main-container {
    max-width: 800px;
    margin: 0 auto;
  }
  
  .card { 
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border: none;
    border-radius: 12px;
    overflow: hidden;
  }
  
  .card-header {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
  }
  
  .card-body {
    padding: 2rem;
  }
  
  .profile-info { display: none; }
  .profile-info.active { display: block; }
  .group-list { max-height: 300px; overflow-y: auto; }
  .group-item { cursor: pointer; }
  .group-item:hover { background: #f8f9fa; }
  .group-item.selected { background: #e9ecef; }
  .group-cover { width: 100%; height: 100px; object-fit: cover; border-radius: 8px; }
  
  .warning-box { 
    border-right: 4px solid var(--warning-color);
    background: #fff3cd;
  }
  
  .terms-box { 
    max-height: 200px; 
    overflow-y: auto;
    background: #f8f9fa;
    border-radius: 8px;
  }
  
  .btn-primary {
    background: var(--primary-color);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
  }
  
  .btn-primary:hover {
    background: #166fe5;
    transform: translateY(-1px);
  }
  
  .form-control {
    border-radius: 8px;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
  }
  
  .form-control:focus {
    box-shadow: 0 0 0 0.2rem rgba(24, 119, 242, 0.25);
    border-color: var(--primary-color);
  }

  .modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1050;
  }

  .modal-content {
    background: white;
    width: 90%;
    max-width: 650px;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transform: translateY(0);
    transition: transform 0.3s ease;
    animation: modalSlideIn 0.3s ease;
  }

  @keyframes modalSlideIn {
    from {
      transform: translateY(20px);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  .modal-header {
    background: #f8fafc;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-direction: row;
    justify-content: flex-start;
  }

  .modal-header i {
    font-size: 1.5rem;
    color: var(--warning-color);
  }

  .modal-header h5 {
    margin: 0;
    font-size: 1.25rem;
    color: #1e293b;
    font-weight: 600;
  }

  .modal-body {
    padding: 1.5rem;
  }

  .modal-body p {
    color: #475569;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    line-height: 1.6;
  }

  .stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
  }

  .stat-card {
    background: #f8fafc;
    padding: 1.25rem;
    border-radius: 12px;
    text-align: center;
  }

  .stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    line-height: 1;
  }

  .stat-label {
    color: #64748b;
    font-size: 0.875rem;
  }

  .modal-footer {
    background: #f8fafc;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
  }

  .btn-modal {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
  }

  .btn-modal:hover {
    transform: translateY(-1px);
  }

  .btn-modal.cancel {
    background: #e2e8f0;
    color: #475569;
  }

  .btn-modal.cancel:hover {
    background: #cbd5e1;
  }

  .btn-modal.delete {
    background: var(--danger-color);
    color: white;
  }

  .btn-modal.delete:hover {
    background: #b91c1c;
  }

  .success-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    width: 90%;
    max-width: 430px;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
    text-align: center;
    z-index: 1051;
    animation: modalSlideIn 0.3s ease;
  }

  .success-icon {
    width: 80px;
    height: 80px;
    background: #dcfce7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
  }

  .success-icon i {
    font-size: 2.5rem;
    color: var(--success-color);
  }

  .success-message h4 {
    color: #1e293b;
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }

  .success-stats {
    background: #f8fafc;
    padding: 1.25rem;
    border-radius: 12px;
    margin: 1.5rem 0;
  }

  .success-stats .deleted-count {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
  }

  .success-stats .time-taken {
    color: #64748b;
    font-size: 0.875rem;
  }

  .btn-success-close {
    background: var(--primary-color);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
  }

  .btn-success-close:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
  }

  .progress-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    z-index: 1000;
  }

  .progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
  }

  .progress-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
  }

  .stat-box {
    background: white;
    padding: 1.25rem;
    border-radius: 8px;
    flex: 1;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  }

  .stat-number {
    font-size: 1.75rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
  }

  .stat-label {
    color: #6c757d;
    font-size: 0.875rem;
  }

  .progress-bar-container {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
  }

  .progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
    border-radius: 4px;
  }

  .progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: #6c757d;
  }

  .post-count {
    position: relative;
    margin: 2rem auto;
    text-align: center;
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  }
  
  .post-count-number {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    line-height: 1;
  }

  .post-count-label {
    color: #64748b;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
  }

  .action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
  }

  .action-button {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
  }

  .action-button:hover:not(:disabled) {
    transform: translateY(-1px);
  }

  .action-button.primary {
    background: var(--primary-color);
    color: white;
  }

  .action-button.primary:hover:not(:disabled) {
    background: #1d4ed8;
  }

  .action-button.danger {
    background: var(--danger-color);
    color: white;
  }

  .action-button.danger:hover:not(:disabled) {
    background: #b91c1c;
  }

  .action-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
  }

  .setup-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
  }

  .setup-step {
    background: white;
    padding: 1.25rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  .step-icon {
    width: 40px;
    height: 40px;
    background: #f0f9ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--secondary-color);
  }

  .step-content {
    flex: 1;
  }

  .step-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
  }

  .step-description {
    color: #6c757d;
    font-size: 0.875rem;
  }

  .step-action {
    margin-right: auto;
  }

  .btn-info {
    background-color: var(--secondary-color);
    border: none;
    color: white;
  }

  .btn-info:hover {
    background-color: #0284c7;
    color: white;
  }
  
  .setup-tools .border {
    border-color: var(--border-color) !important;
    transition: all 0.3s ease;
  }
  
  .setup-tools a:hover .border {
    border-color: var(--secondary-color) !important;
    background: #f0f9ff;
  }

  @media (max-width: 768px) {
    .main-container {
      padding: 1rem;
    }
    
    .progress-container,
    .success-message {
      width: 95%;
      max-width: none;
    }

    .progress-stats {
      flex-direction: column;
      gap: 1rem;
    }
  }

  .toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1060;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 380px;
    max-width: 90%;
  }

  .toast {
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    width: 100%;
    overflow: hidden;
    display: none;
    animation: slideInRight 0.3s ease-out;
    border: 1px solid var(--border-color);
  }

  @keyframes slideInRight {
    from {
      transform: translateX(100%);
      opacity: 0;
    }
    to {
      transform: translateX(0);
      opacity: 1;
    }
  }

  @keyframes slideOutRight {
    from {
      transform: translateX(0);
      opacity: 1;
    }
    to {
      transform: translateX(100%);
      opacity: 0;
    }
  }

  .toast-header {
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
  }

  .toast-header .btn-close {
    margin: 0;
    padding: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e2e8f0;
    opacity: 1;
    transition: all 0.2s ease;
  }

  .toast-header .btn-close:hover {
    background: #cbd5e1;
  }

  .toast-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .toast-icon i {
    font-size: 1.1rem;
    color: white;
  }

  .toast-title {
    font-weight: 600;
    font-size: 1rem;
    flex-grow: 1;
    margin: 0;
    line-height: 1.5;
  }

  .toast-body {
    padding: 1rem 1.25rem;
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.6;
  }

  .toast-error {
    border-right: 4px solid var(--danger-color);
  }

  .toast-warning {
    border-right: 4px solid var(--warning-color);
  }

  .toast-info {
    border-right: 4px solid var(--secondary-color);
  }

  .toast-success {
    border-right: 4px solid var(--success-color);
  }

  .toast-error .toast-icon {
    background: var(--danger-color);
  }

  .toast-warning .toast-icon {
    background: var(--warning-color);
  }

  .toast-info .toast-icon {
    background: var(--secondary-color);
  }

  .toast-success .toast-icon {
    background: var(--success-color);
  }

  .input-section, .process-section {
    transition: all 0.3s ease;
  }

  .input-section.hidden, .process-section.hidden {
    display: none;
    opacity: 0;
  }

  .process-section {
    animation: fadeIn 0.3s ease;
  }

  @keyframes fadeIn {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1050;
  }

  .loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
  }

  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
