/* CHAMA CONTACT PUSH - Components Styles */
/* Buttons, Forms, Modals, and Interactive Elements */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  font-size: var(--font-size-md);
  font-weight: 500;
  line-height: 1.5;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  user-select: none;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

.btn:active {
  transform: translateY(0);
  transition: transform var(--transition-fast);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn:disabled:hover {
  transform: none;
  box-shadow: none;
}

/* Button Variants */
.btn-primary {
  background: var(--gradient-button);
  color: var(--text-primary);
  border-color: var(--light-red);
  box-shadow: var(--shadow-light);
}

.btn-primary:hover {
  background: linear-gradient(145deg, var(--dark-red), #990000);
  box-shadow: var(--shadow-heavy);
}

.btn-secondary {
  background: var(--gradient-card);
  color: var(--text-primary);
  border-color: var(--border-primary);
  box-shadow: var(--shadow-light);
}

.btn-secondary:hover {
  background: linear-gradient(145deg, var(--bg-tertiary), var(--bg-secondary));
  border-color: var(--border-accent);
  box-shadow: var(--shadow-medium);
}

.btn-success {
  background: var(--gradient-button);
  color: var(--text-primary);
  border-color: var(--light-red);
  box-shadow: var(--shadow-light);
  position: relative;
}

.btn-success:hover {
  background: linear-gradient(145deg, var(--dark-red), #990000);
  box-shadow: var(--shadow-heavy);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-primary);
}

.btn-outline:hover {
  background: var(--gradient-card);
  border-color: var(--border-accent);
  color: var(--text-accent);
}

/* Button Sizes */
.btn-sm {
  padding: var(--space-xs) var(--space-md);
  font-size: var(--font-size-sm);
}

.btn-large {
  padding: var(--space-lg) var(--space-xl);
  font-size: var(--font-size-lg);
  font-weight: 600;
}

/* Button Effects */
.btn-glow {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--gradient-glow);
  opacity: 0;
  transition: all var(--transition-slow);
  z-index: -1;
}

.btn-success:hover .btn-glow {
  left: 0;
  opacity: 0.3;
}

/* Form Elements */
.form-input {
  width: 100%;
  padding: var(--space-md);
  font-size: var(--font-size-md);
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border: 2px solid var(--border-primary);
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
}

.form-input:focus {
  outline: none;
  border-color: var(--border-accent);
  box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.3);
  background: var(--bg-secondary);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* File Input */
.file-input {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.file-input::-webkit-file-upload-button {
  visibility: hidden;
}

.file-input::before {
  content: 'Choose File';
  display: inline-block;
  background: var(--gradient-button);
  color: var(--text-primary);
  border: none;
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  margin-right: var(--space-md);
  cursor: pointer;
  font-size: var(--font-size-sm);
  font-weight: 500;
}

.file-input:hover::before {
  background: linear-gradient(145deg, var(--dark-red), #990000);
}

/* Textarea */
.message-textarea {
  width: 100%;
  min-height: 120px;
  padding: var(--space-md);
  font-size: var(--font-size-md);
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border: 2px solid var(--border-primary);
  border-radius: var(--radius-md);
  resize: vertical;
  transition: all var(--transition-normal);
}

.message-textarea:focus {
  outline: none;
  border-color: var(--border-accent);
  box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.3);
  background: var(--bg-secondary);
}

.message-textarea::placeholder {
  color: var(--text-muted);
}

/* Input Groups */
.input-group {
  display: flex;
  gap: var(--space-md);
  align-items: stretch;
}

.input-group .form-input {
  flex: 1;
}

.input-group .btn {
  flex-shrink: 0;
}

/* Option Groups */
.option-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.option-group label {
  font-weight: 500;
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.option-group label i {
  color: var(--text-accent);
}

.message-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  margin: var(--space-lg) 0;
}

/* Checkboxes */
.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  font-size: var(--font-size-md);
  color: var(--text-primary);
}

.checkbox-wrapper input[type="checkbox"] {
  opacity: 0;
  position: absolute;
  pointer-events: none;
}

.checkbox-custom {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-primary);
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  position: relative;
  transition: all var(--transition-normal);
}

.checkbox-wrapper:hover .checkbox-custom {
  border-color: var(--border-accent);
  background: var(--bg-secondary);
}

.checkbox-wrapper input:checked + .checkbox-custom {
  background: var(--gradient-button);
  border-color: var(--border-accent);
}

.checkbox-wrapper input:checked + .checkbox-custom::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 6px;
  height: 10px;
  border: solid var(--text-primary);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

.checkbox-label {
  font-weight: 500;
}

/* Send Controls */
.send-controls {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

.send-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* Groups List */
.groups-container {
    margin-top: var(--space-lg);
}

/* Group Suggestions */
.suggestions-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--gradient-card);
    border: 2px solid var(--border-accent);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-heavy);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    border-bottom: 1px solid var(--border-subtle);
}

.suggestion-item:hover {
    background: var(--bg-secondary);
    transform: translateX(4px);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item i {
    color: var(--text-accent);
    font-size: var(--font-size-sm);
}

.suggestion-item span {
    flex: 1;
    color: var(--text-primary);
    font-weight: 500;
}

.suggestion-item small {
    color: var(--text-secondary);
    font-size: var(--font-size-xs);
}

.group-input-section {
    position: relative;
}

.groups-list {
  max-height: 300px;
  overflow-y: auto;
  border: 2px solid var(--border-primary);
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
}

.group-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--gradient-card);
  border-left: 4px solid var(--border-accent);
  margin-bottom: 1px;
  transition: all var(--transition-normal);
}

.group-item:hover {
  background: linear-gradient(145deg, var(--bg-secondary), var(--bg-tertiary));
  transform: translateX(4px);
}

.group-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.group-info {
  flex: 1;
}

.group-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: var(--font-size-md);
}

.group-status {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-top: var(--space-xs);
}

.group-remove {
  background: var(--gradient-button);
  color: var(--text-primary);
  border: 1px solid var(--light-red);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.group-remove:hover {
  background: linear-gradient(145deg, var(--dark-red), #990000);
  transform: scale(1.05);
}

/* Statistics Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-lg);
}

.stat-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
}

.stat-item:hover {
  background: var(--bg-secondary);
  border-color: var(--border-accent);
  transform: translateY(-2px);
}

.stat-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-button);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--font-size-lg);
}

.stat-info {
  flex: 1;
  min-width: 0;
}

.stat-number {
  display: block;
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-label {
  display: block;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-top: var(--space-xs);
}

/* QR Code Section */
.qr-section {
  margin-bottom: var(--space-xl);
}

.qr-card {
  background: var(--gradient-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
  box-shadow: var(--shadow-medium);
}

.qr-card h3 {
  color: var(--text-accent);
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-lg);
  text-shadow: 0 0 5px var(--primary-red);
}

.qr-container {
  display: inline-block;
  position: relative;
  padding: var(--space-lg);
  background: var(--text-primary);
  border-radius: var(--radius-md);
  margin: var(--space-lg) 0;
  box-shadow: var(--shadow-heavy);
  border: 2px solid var(--border-accent);
}

.qr-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.scanning-line {
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-glow);
  animation: scan 2s linear infinite;
  opacity: 0.8;
}

.qr-instructions {
  text-align: left;
  max-width: 300px;
  margin: 0 auto;
}

.qr-instructions p {
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: var(--space-md);
}

.qr-instructions ol {
  color: var(--text-secondary);
  padding-left: var(--space-lg);
}

.qr-instructions li {
  margin-bottom: var(--space-sm);
  line-height: 1.5;
}

/* Activity Log */
.log-container {
  max-height: 400px;
  overflow-y: auto;
  border: 2px solid var(--border-primary);
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
}

.log-entry {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--gradient-card);
  border-left: 4px solid var(--success);
  transition: all var(--transition-normal);
}

.log-entry:hover {
  background: linear-gradient(145deg, var(--bg-secondary), var(--bg-tertiary));
}

.log-entry:last-child {
  border-bottom: none;
}

.log-entry.error {
  border-left-color: var(--error);
}

.log-entry.warning {
  border-left-color: var(--warning);
}

.log-entry.info {
  border-left-color: var(--info);
}

.log-timestamp {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

.log-message {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.log-details {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Message Tools */
.message-tools {
  display: flex;
  gap: var(--space-sm);
}

.log-controls {
  display: flex;
  gap: var(--space-sm);
}

/* Modals */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  backdrop-filter: blur(4px);
}

.modal.show {
  display: flex;
}

.modal-content {
  background: var(--gradient-card);
  border: 2px solid var(--border-accent);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-heavy);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow: hidden;
  animation: modalSlideIn 0.3s ease;
}

.modal-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 0, 0, 0.05);
}

.modal-header h3 {
  color: var(--text-accent);
  font-size: var(--font-size-lg);
  font-weight: 600;
  text-shadow: 0 0 5px var(--primary-red);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: var(--font-size-lg);
  cursor: pointer;
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  transition: all var(--transition-normal);
}

.modal-close:hover {
  color: var(--text-accent);
  background: var(--bg-tertiary);
}

.modal-body {
  padding: var(--space-lg);
  max-height: 60vh;
  overflow-y: auto;
}

.modal-footer {
  padding: var(--space-lg);
  border-top: 1px solid var(--border-primary);
  display: flex;
  gap: var(--space-md);
  justify-content: flex-end;
}

/* Settings */
.settings-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.setting-group h4 {
  color: var(--text-accent);
  font-size: var(--font-size-lg);
  font-weight: 600;
  margin-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: var(--space-sm);
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.setting-item:hover {
  background: var(--bg-secondary);
  border-color: var(--border-accent);
}

.setting-item span {
  color: var(--text-primary);
  font-weight: 500;
}

.setting-item input[type="checkbox"] {
  margin: 0;
}

.setting-item input[type="number"] {
  width: 80px;
  margin: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  color: var(--text-primary);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: var(--z-overlay);
  backdrop-filter: blur(4px);
}

.loading-spinner-large {
  width: 80px;
  height: 80px;
  border: 6px solid var(--border-primary);
  border-top: 6px solid var(--primary-red);
  border-radius: var(--radius-full);
  animation: spin 1s linear infinite;
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-glow);
}

.loading-overlay p {
  color: var(--text-primary);
  font-size: var(--font-size-lg);
  text-align: center;
}

/* Notifications */
.notification-container {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  z-index: var(--z-tooltip);
  max-width: 400px;
}

.notification {
  background: var(--gradient-card);
  border: 1px solid var(--border-primary);
  border-left: 4px solid var(--success);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  box-shadow: var(--shadow-heavy);
  transform: translateX(100%);
  animation: slideInRight 0.3s ease forwards;
}

.notification.success {
  border-left-color: var(--success);
}

.notification.error {
  border-left-color: var(--error);
}

.notification.warning {
  border-left-color: var(--warning);
}

.notification.info {
  border-left-color: var(--info);
}

.notification-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.notification-message {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  line-height: 1.4;
}

/* Responsive Components */
@media (max-width: 768px) {
  .input-group {
    flex-direction: column;
  }
  
  .message-options-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  
  .send-controls {
    gap: var(--space-md);
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  
  .stat-item {
    padding: var(--space-md);
  }
  
  .modal-content {
    margin: var(--space-md);
    width: calc(100% - 2rem);
  }
  
  .modal-footer {
    flex-direction: column;
  }
  
  .message-tools,
  .log-controls {
    flex-direction: column;
    gap: var(--space-sm);
  }
  
  .notification-container {
    top: var(--space-sm);
    right: var(--space-sm);
    left: var(--space-sm);
    max-width: none;
  }
}

@media (max-width: 480px) {
  .btn {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-sm);
  }
  
  .btn-large {
    padding: var(--space-md) var(--space-lg);
    font-size: var(--font-size-md);
  }
  
  .groups-list {
    max-height: 200px;
  }
  
  .log-container {
    max-height: 250px;
  }
}
