/* ==================== IMPROVED CAMPAIGN SECTION DESIGN ==================== */

/* Campaign Page Header */
#campaignsPage .head-title h1 {
    background: linear-gradient(135deg, var(--primary-green), var(--dark-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  
  /* Campaign Stats Cards - Better Colors */
  #campaignsPage .box-info li:nth-child(1) {
    background: linear-gradient(135deg, #fff5f5, #ffe5e5);
    border-left: 4px solid var(--orange);
  }
  
  #campaignsPage .box-info li:nth-child(2) {
    background: linear-gradient(135deg, #fffef0, #fff9d0);
    border-left: 4px solid var(--yellow);
  }
  
  #campaignsPage .box-info li:nth-child(3) {
    background: linear-gradient(135deg, #fff0f0, #ffe0e0);
    border-left: 4px solid var(--red);
  }
  
  #campaignsPage .box-info li:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
  }
  
  /* Segment Cards - Enhanced Design */
  .segment-card {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
  }
  
  .segment-card::after {
    content: '';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid currentColor;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    opacity: 0;
    transition: all 0.3s ease;
  }
  
  .segment-card:hover::after {
    opacity: 0.5;
    right: 12px;
  }
  
  .segment-card:hover {
    transform: translateX(8px) scale(1.02);
    box-shadow: -6px 0 0 var(--primary-green), 0 8px 20px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-green);
  }
  
  /* Segment Icons Animation */
  .segment-card:hover i {
    animation: iconBounce 0.6s ease;
  }
  
  @keyframes iconBounce {
    0%, 100% {
      transform: scale(1);
    }
    50% {
      transform: scale(1.2) rotate(10deg);
    }
  }
  
  /* Campaign Badge Pulse */
  .campaign-badge {
    animation: badgePulse 2s ease-in-out infinite;
    box-shadow: 0 0 10px currentColor;
  }
  
  @keyframes badgePulse {
    0%, 100% {
      transform: scale(1);
      opacity: 1;
    }
    50% {
      transform: scale(1.1);
      opacity: 0.8;
    }
  }
  
  /* Segment Preview Box */
  #segmentPreview {
    animation: slideDown 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 12px rgba(6, 193, 104, 0.2);
  }
  
  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  /* Customer Preview List - Better Styling */
  #customerPreviewList {
    position: relative;
  }
  
  #customerPreviewList > div {
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--grey);
  }
  
  #customerPreviewList > div:hover {
    background: var(--mint);
    transform: translateX(4px);
  }
  
  #customerPreviewList > div:last-child {
    border-bottom: none;
  }
  
  /* Test Message Button - Enhanced */
  button[onclick*="showTestMessageModal"] {
    position: relative;
    overflow: hidden;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
  }
  
  button[onclick*="showTestMessageModal"]::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
  }
  
  button[onclick*="showTestMessageModal"]:hover::before {
    width: 300px;
    height: 300px;
  }
  
  button[onclick*="showTestMessageModal"]:hover {
    background: #FEC700 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(254, 209, 48, 0.4);
  }
  
  /* Message Template Textarea - Better Design */
  #campaignMessage {
    font-family: var(--poppins);
    font-size: 15px;
    line-height: 1.8;
    transition: all 0.3s ease;
    background: var(--light);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
  }
  
  #campaignMessage:focus {
    background: white;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 4px rgba(6, 193, 104, 0.1), inset 0 2px 4px rgba(0, 0, 0, 0.05);
    transform: scale(1.01);
  }
  
  #campaignMessage::placeholder {
    color: var(--dark-grey);
    opacity: 0.6;
  }
  
  /* Character Counter */
  #messageCharCount {
    font-weight: 600;
    color: var(--primary-green);
  }
  
  /* Quick Template Buttons - Improved */
  .template-btn {
    position: relative;
    overflow: hidden;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid var(--grey);
    background: white;
  }
  
  .template-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: var(--primary-green);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
    z-index: 0;
  }
  
  .template-btn:hover::before {
    width: 200px;
    height: 200px;
  }
  
  .template-btn:hover {
    color: white !important;
    border-color: var(--primary-green);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(6, 193, 104, 0.3);
  }
  
  .template-btn span,
  .template-btn {
    position: relative;
    z-index: 1;
  }
  
  /* Send Campaign Button - Epic Design */
  #sendCampaignBtn {
    position: relative;
    overflow: hidden;
    font-size: 17px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 12px rgba(6, 193, 104, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  #sendCampaignBtn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
  }
  
  #sendCampaignBtn:hover::before {
    width: 400px;
    height: 400px;
  }
  
  #sendCampaignBtn:hover {
    background: var(--dark-green) !important;
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 20px rgba(6, 193, 104, 0.4);
  }
  
  #sendCampaignBtn:active {
    transform: translateY(-2px) scale(0.98);
  }
  
  #sendCampaignBtn i {
    animation: sendIconFloat 2s ease-in-out infinite;
  }
  
  @keyframes sendIconFloat {
    0%, 100% {
      transform: translateX(0);
    }
    50% {
      transform: translateX(4px);
    }
  }
  
  /* Empty State - Better Design */
  #campaignEmptyState {
    animation: fadeIn 0.5s ease;
  }
  
  #campaignEmptyState i {
    animation: float 3s ease-in-out infinite;
  }
  
  @keyframes float {
    0%, 100% {
      transform: translateY(0);
    }
    50% {
      transform: translateY(-10px);
    }
  }
  
  /* Info Boxes - Enhanced */
  div[style*="background: var(--light-yellow)"],
  div[style*="background: var(--mint)"] {
    transition: all 0.3s ease;
  }
  
  div[style*="background: var(--light-yellow)"]:hover {
    background: #FFF9C6 !important;
    transform: translateX(4px);
  }
  
  div[style*="background: var(--mint)"]:hover {
    background: #D5F5E3 !important;
    transform: translateX(4px);
  }
  
  /* Campaign Title */
  #campaignTitle {
    position: relative;
    display: inline-block;
  }
  
  #campaignTitle::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--primary-green);
    transition: width 0.3s ease;
  }
  
  #campaignTitle:hover::after {
    width: 100%;
  }
  
  /* Segment Count Badge */
  #segmentCount {
    text-shadow: 0 2px 4px rgba(6, 193, 104, 0.3);
    animation: countPulse 1.5s ease-in-out infinite;
  }
  
  @keyframes countPulse {
    0%, 100% {
      transform: scale(1);
    }
    50% {
      transform: scale(1.1);
    }
  }
  
  /* Mobile Responsiveness for Campaign */
  @media screen and (max-width: 768px) {
    .segment-card {
      padding: 12px !important;
    }
    
    .template-btn {
      font-size: 11px !important;
      padding: 6px 10px !important;
    }
    
    #sendCampaignBtn {
      font-size: 14px;
      padding: 12px !important;
    }
    
    #campaignMessage {
      font-size: 14px;
    }
  }
  
  /* Dark Mode Campaign Adjustments */
  body.dark #campaignsPage .box-info li:nth-child(1) {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
  }
  
  body.dark #campaignsPage .box-info li:nth-child(2) {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
  }
  
  body.dark #campaignsPage .box-info li:nth-child(3) {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
  }
  
  /* Loading State for Campaign */
  .campaign-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
  }
  
  /* Success Animation */
  @keyframes successPop {
    0% {
      transform: scale(0);
      opacity: 0;
    }
    50% {
      transform: scale(1.2);
    }
    100% {
      transform: scale(1);
      opacity: 1;
    }
  }
  
  .success-icon {
    animation: successPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  