/* WhatsApp Bulk Message Sender Panel - Styles */

:root {
  --wa-green: #25d366;
  --wa-dark-green: #128c7e;
  --wa-light-green: #dcf8c6;
  --wa-teal: #075e54;
  --wa-blue: #34b7f1;
  --sidebar-width: 260px;
  --header-height: 60px;
  --bg-light: #f0f2f5;
  --bg-white: #ffffff;
  --text-dark: #111b21;
  --text-muted: #667781;
  --border-color: #e9edef;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.15);
  --radius: 8px;
  --radius-lg: 12px;
}

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

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.6;
}

/* Auth Pages */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--wa-teal) 0%, var(--wa-dark-green) 100%);
  padding: 20px;
}

.auth-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  padding: 40px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 30px;
}

.auth-logo i {
  font-size: 64px;
  color: var(--wa-green);
}

.auth-logo h1 {
  font-size: 24px;
  color: var(--text-dark);
  margin-top: 10px;
}

.auth-logo p {
  color: var(--text-muted);
  font-size: 14px;
}

/* Layout */
.layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--wa-teal);
  color: white;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 1000;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header i {
  font-size: 32px;
  color: var(--wa-green);
}

.sidebar-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.sidebar-nav {
  padding: 15px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.15);
  border-left-color: var(--wa-green);
  color: white;
}

.nav-item i {
  width: 20px;
  font-size: 18px;
}

.sidebar-footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  padding: 15px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--wa-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.user-details {
  flex: 1;
}

.user-details .name {
  font-weight: 600;
  font-size: 14px;
}

.user-details .email {
  font-size: 12px;
  opacity: 0.8;
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: var(--radius);
  color: white;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
  justify-content: center;
}

.logout-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

.header {
  height: var(--header-height);
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header h1 {
  font-size: 22px;
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-dark);
}

.content {
  padding: 30px;
}

/* Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 25px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 20px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white;
}

.stat-icon.green {
  background: linear-gradient(135deg, var(--wa-green), var(--wa-dark-green));
}
.stat-icon.teal {
  background: linear-gradient(135deg, var(--wa-teal), #0a4f47);
}
.stat-icon.blue {
  background: linear-gradient(135deg, var(--wa-blue), #2196f3);
}
.stat-icon.orange {
  background: linear-gradient(135deg, #ff9800, #f57c00);
}

.stat-info h3 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-dark);
}

.stat-info p {
  color: var(--text-muted);
  font-size: 14px;
}

/* Card Component */
.card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.card-header {
  padding: 20px 25px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 15px;
}

.card-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.card-body {
  padding: 25px;
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-dark);
}

.form-control {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--wa-green);
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--wa-green);
  color: white;
}

.btn-primary:hover {
  background: var(--wa-dark-green);
}

.btn-secondary {
  background: var(--bg-light);
  color: var(--text-dark);
}

.btn-secondary:hover {
  background: var(--border-color);
}

.btn-danger {
  background: #dc3545;
  color: white;
}

.btn-danger:hover {
  background: #c82333;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
}

/* Tables */
.table-responsive {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.table th {
  background: var(--bg-light);
  font-weight: 600;
  color: var(--text-dark);
  white-space: nowrap;
}

.table tbody tr:hover {
  background: #f8f9fa;
}

.table-actions {
  display: flex;
  gap: 8px;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.badge-success {
  background: var(--wa-light-green);
  color: var(--wa-dark-green);
}

.badge-danger {
  background: #ffebee;
  color: #dc3545;
}

.badge-warning {
  background: #fff3e0;
  color: #f57c00;
}

.badge-info {
  background: #e3f2fd;
  color: var(--wa-blue);
}

/* Alerts */
.alert {
  padding: 15px 20px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-success {
  background: var(--wa-light-green);
  color: var(--wa-dark-green);
  border: 1px solid var(--wa-green);
}

.alert-danger {
  background: #ffebee;
  color: #dc3545;
  border: 1px solid #dc3545;
}

.alert-info {
  background: #e3f2fd;
  color: var(--wa-blue);
  border: 1px solid var(--wa-blue);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.3s;
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal-header {
  padding: 20px 25px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-body {
  padding: 25px;
}

.modal-footer {
  padding: 15px 25px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Checkbox */
.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-wrapper input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--wa-green);
}

/* File Upload */
.file-upload {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.file-upload:hover {
  border-color: var(--wa-green);
  background: rgba(37, 211, 102, 0.05);
}

.file-upload i {
  font-size: 40px;
  color: var(--wa-green);
  margin-bottom: 10px;
}

.file-upload input {
  display: none;
}

/* Search & Filters */
.search-box {
  position: relative;
}

.search-box input {
  padding-left: 40px;
}

.search-box i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.filters {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  align-items: center;
}

.filters .form-control {
  width: auto;
  min-width: 150px;
}

/* Progress */
.progress-bar {
  height: 8px;
  background: var(--bg-light);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 10px;
}

.progress-fill {
  height: 100%;
  background: var(--wa-green);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 64px;
  margin-bottom: 15px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 18px;
  margin-bottom: 10px;
  color: var(--text-dark);
}

/* Contact Selection */
.contact-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.2s;
}

.contact-item:last-child {
  border-bottom: none;
}

.contact-item:hover {
  background: var(--bg-light);
}

.contact-item.selected {
  background: var(--wa-light-green);
}

.contact-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--wa-green);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.contact-info {
  flex: 1;
}

.contact-info .name {
  font-weight: 500;
}

.contact-info .phone {
  font-size: 13px;
  color: var(--text-muted);
}

/* Message Preview */
.message-preview {
  background: var(--wa-light-green);
  border-radius: var(--radius);
  padding: 15px;
  position: relative;
  margin-top: 10px;
}

.message-preview::before {
  content: "";
  position: absolute;
  top: 0;
  left: -8px;
  border-width: 8px;
  border-style: solid;
  border-color: var(--wa-light-green) var(--wa-light-green) transparent transparent;
}

/* Sending Progress */
.sending-progress {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 30px;
  text-align: center;
}

.sending-progress .icon {
  font-size: 48px;
  color: var(--wa-green);
  margin-bottom: 15px;
}

.sending-progress h3 {
  margin-bottom: 10px;
}

.sending-progress .count {
  font-size: 24px;
  font-weight: bold;
  color: var(--wa-green);
  margin: 15px 0;
}

/* Responsive */
@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .mobile-toggle {
    display: block;
  }

  .overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
  }

  .overlay.active {
    display: block;
  }
}

@media (max-width: 768px) {
  .content {
    padding: 20px;
  }

  .header {
    padding: 0 20px;
  }

  .stat-card {
    padding: 20px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .filters {
    flex-direction: column;
    align-items: stretch;
  }

  .filters .form-control {
    width: 100%;
  }
}
