/* Component Styles - Forms, Inputs, Modals, Cards */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  user-select: none;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Primary Button */
.btn-primary {
  background: #5865F2;
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #4752C4;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(88, 101, 242, 0.4);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

/* Secondary Button */
.btn-secondary {
  background: #e3e5e8;
  color: #2c2f33;
  border: 1px solid #d0d0d0;
}

.btn-secondary:hover:not(:disabled) {
  background: #d0d0d0;
  border-color: #999;
}

/* Success Button */
.btn-success {
  background: #3ba55e;
  color: white;
}

.btn-success:hover:not(:disabled) {
  background: #2d8a4a;
  box-shadow: 0 4px 12px rgba(59, 165, 94, 0.4);
}

/* Danger Button */
.btn-danger {
  background: #ed4245;
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: #c03537;
  box-shadow: 0 4px 12px rgba(237, 66, 69, 0.4);
}

/* Ghost Button */
.btn-ghost {
  background: transparent;
  color: #5865F2;
  border: 1px solid #5865F2;
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(88, 101, 242, 0.1);
  border-color: #4752C4;
}

/* Link Button */
.btn-link {
  background: transparent;
  color: #5865F2;
  padding: 0;
  text-decoration: underline;
}

.btn-link:hover {
  color: #4752C4;
}

/* Small Button */
.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* Large Button */
.btn-lg {
  padding: 14px 24px;
  font-size: 16px;
}

/* Block Button */
.btn-block {
  width: 100%;
}

/* Form Elements */
.form-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
}

.form-label {
  font-weight: 600;
  margin-bottom: 8px;
  color: #2c2f33;
  font-size: 14px;
}

.form-label .form-required {
  color: #ed4245;
}

.form-input,
.form-select,
.form-textarea {
  padding: 10px 12px;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: white;
  color: #2c2f33;
  transition: all 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: #5865F2;
  box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.1);
}

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
  background: #f2f3f5;
  color: #72767d;
  cursor: not-allowed;
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
  font-family: monospace;
}

.form-help {
  font-size: 12px;
  color: #72767d;
  margin-top: 6px;
}

.form-error {
  font-size: 12px;
  color: #ed4245;
  margin-top: 6px;
}

.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: #ed4245;
  background-color: rgba(237, 66, 69, 0.05);
}

/* Checkbox & Radio */
.form-checkbox,
.form-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
}

.form-checkbox input,
.form-radio input {
  cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #5865F2;
}

.form-radio input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: #5865F2;
}

/* Select */
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%235865F2' d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px;
  padding-right: 32px;
}

/* Cards */
.card {
  background: white;
  border: 1px solid #e3e5e8;
  border-radius: 8px;
  overflow: hidden;
}

.card-header {
  padding: 16px;
  background: #f2f3f5;
  border-bottom: 1px solid #e3e5e8;
}

.card-body {
  padding: 16px;
}

.card-footer {
  padding: 16px;
  background: #f2f3f5;
  border-top: 1px solid #e3e5e8;
}

.card-header h3,
.card-header h2 {
  margin: 0;
  font-size: 16px;
}

/* Alert/Notice */
.alert {
  padding: 12px 16px;
  border-radius: 6px;
  border-left: 4px solid;
  margin-bottom: 16px;
  font-size: 14px;
}

.alert-info {
  background: rgba(0, 176, 244, 0.1);
  border-color: #00b0f4;
  color: #0087bf;
}

.alert-success {
  background: rgba(59, 165, 94, 0.1);
  border-color: #3ba55e;
  color: #2d8a4a;
}

.alert-warning {
  background: rgba(250, 166, 26, 0.1);
  border-color: #faa61a;
  color: #c68408;
}

.alert-danger {
  background: rgba(237, 66, 69, 0.1);
  border-color: #ed4245;
  color: #c03537;
}

.alert-title {
  font-weight: 600;
  margin-bottom: 4px;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: fit-content;
}

.badge-primary {
  background: rgba(88, 101, 242, 0.1);
  color: #5865F2;
}

.badge-success {
  background: rgba(59, 165, 94, 0.1);
  color: #3ba55e;
}

.badge-warning {
  background: rgba(250, 166, 26, 0.1);
  color: #faa61a;
}

.badge-danger {
  background: rgba(237, 66, 69, 0.1);
  color: #ed4245;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  animation: fade-in 0.2s ease;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slide-up 0.3s ease;
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid #e3e5e8;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #72767d;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: #2c2f33;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 20px;
  border-top: 1px solid #e3e5e8;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Tooltip */
.tooltip-trigger {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted #5865F2;
}

.tooltip {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #2c2f33;
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 100;
  margin-bottom: 8px;
  pointer-events: none;
}

.tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #2c2f33;
}

.tooltip-trigger:hover .tooltip {
  display: block;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e3e5e8;
  margin-bottom: 20px;
}

.tab {
  padding: 12px 16px;
  border: none;
  background: none;
  color: #72767d;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s ease;
}

.tab:hover {
  color: #2c2f33;
}

.tab.active {
  color: #5865F2;
  border-bottom-color: #5865F2;
}

/* Animations */
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Loading Skeleton */
.skeleton {
  display: inline-block;
  background: linear-gradient(90deg, #e3e5e8 25%, #f2f3f5 50%, #e3e5e8 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Responsive */
@media (max-width: 768px) {
  .btn {
    padding: 10px 12px;
    font-size: 13px;
  }

  .modal-content {
    max-width: 100%;
    border-radius: 12px 12px 0 0;
  }

  .tabs {
    overflow-x: auto;
  }
}
