/**
 * MaciVekker Frontend CSS v1.2.0 - Accordion Design
 */

/* ═══════════════════════════════════════════════════════════════════════
   Accordion komponens
   ═══════════════════════════════════════════════════════════════════════ */

.mvf-accordion {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
  background: white;
}

.mvf-accordion-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #f8f9fa;
  border: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  text-align: left;
  transition: background 0.2s;
}

.mvf-accordion-toggle:hover {
  background: #e9ecef;
}

.mvf-accordion-open {
  background: #e7f3ff;
}

.mvf-accordion-open:hover {
  background: #d0e7ff;
}

.mvf-accordion-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.mvf-accordion-title {
  flex: 1;
}

.mvf-accordion-arrow {
  font-size: 12px;
  color: #666;
  transition: transform 0.3s;
}

.mvf-accordion-open .mvf-accordion-arrow {
  transform: rotate(90deg);
}

.mvf-accordion-content {
  padding: 20px;
  border-top: 1px solid #e0e0e0;
}

/* ═══════════════════════════════════════════════════════════════════════
   Form elemek
   ═══════════════════════════════════════════════════════════════════════ */

.mvf-field {
  margin-bottom: 20px;
}

.mvf-field label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 14px;
  color: #333;
}

.mvf-input,
.mvf-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.mvf-input:focus,
.mvf-select:focus {
  outline: none;
  border-color: #4CAF50;
}

.mvf-range {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #e0e0e0;
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.mvf-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #4CAF50;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.mvf-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #4CAF50;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.mvf-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  cursor: pointer;
}

.mvf-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.mvf-info {
  padding: 12px;
  background: #e3f2fd;
  border-left: 4px solid #2196F3;
  border-radius: 4px;
  font-size: 13px;
  color: #555;
  margin: 16px 0;
}

.mvf-divider {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 24px 0;
}

/* ═══════════════════════════════════════════════════════════════════════
   Gombok
   ═══════════════════════════════════════════════════════════════════════ */

.mvf-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-block;
}

.mvf-btn-primary {
  background: #4CAF50;
  color: white;
}

.mvf-btn-primary:hover {
  background: #45a049;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

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

.mvf-btn-danger:hover {
  background: #da190b;
}

.mvf-btn-ghost {
  background: transparent;
  color: #666;
  border: 1px solid #ddd;
}

.mvf-btn-ghost:hover {
  background: #f5f5f5;
}

/* ═══════════════════════════════════════════════════════════════════════
   Kártya alapok
   ═══════════════════════════════════════════════════════════════════════ */

.mvf-wrap {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

.mvf-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.mvf-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 28px;
  margin: 0;
}

.mvf-icon {
  font-size: 32px;
}

.mvf-card {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.mvf-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 2px solid #f0f0f0;
}

.mvf-card-icon {
  font-size: 40px;
}

.mvf-card-info {
  flex: 1;
}

.mvf-device-name {
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.mvf-device-id {
  font-size: 13px;
  color: #999;
  font-family: monospace;
}

.mvf-status {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.mvf-status-text {
  display: inline-block;
}

.mvf-status-unknown {
  background: #e0e0e0;
  color: #666;
}

.mvf-status-online {
  background: #4CAF50;
  color: white;
}

.mvf-status-offline {
  background: #f44336;
  color: white;
}

.mvf-alarm-status {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
}

.mvf-badge {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
}

.mvf-badge-on {
  background: #4CAF50;
  color: white;
}

.mvf-badge-off {
  background: #ccc;
  color: #666;
}

.mvf-badge-wake {
  background: #ff9800;
  color: white;
}

.mvf-alarm-time {
  font-size: 20px;
  font-weight: 600;
  font-family: monospace;
}

.mvf-ip {
  margin-bottom: 16px;
}

.mvf-ip a {
  color: #2196F3;
  text-decoration: none;
  font-size: 14px;
}

.mvf-ip a:hover {
  text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════════════════
   Notice
   ═══════════════════════════════════════════════════════════════════════ */

.mvf-notice {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 14px;
}

.mvf-notice-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.mvf-notice-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* ═══════════════════════════════════════════════════════════════════════
   Modal
   ═══════════════════════════════════════════════════════════════════════ */

.mvf-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mvf-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
}

.mvf-modal-box {
  position: relative;
  background: white;
  border-radius: 12px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.mvf-modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
}

.mvf-modal-close:hover {
  color: #333;
}

.mvf-modal h2 {
  margin: 0 0 20px 0;
  font-size: 24px;
}

.mvf-modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.mvf-help {
  font-size: 12px;
  color: #666;
  margin-top: 4px;
}

.mvf-required {
  color: #f44336;
}

/* ═══════════════════════════════════════════════════════════════════════
   Üres állapot
   ═══════════════════════════════════════════════════════════════════════ */

.mvf-empty {
  text-align: center;
  padding: 60px 20px;
}

.mvf-empty-icon {
  font-size: 80px;
  margin-bottom: 20px;
  opacity: 0.5;
}

.mvf-empty h2 {
  font-size: 24px;
  color: #333;
  margin-bottom: 12px;
}

.mvf-empty p {
  color: #666;
  margin-bottom: 24px;
}

/* Help szöveg stílus */
.mvf-help {
  display: block;
  font-size: 12px;
  color: #666;
  margin-top: 4px;
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════════════
   Schedules (Heti napirend)
   ═══════════════════════════════════════════════════════════════════════ */

.mvf-schedule-item {
  padding: 12px;
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  margin-bottom: 10px;
  transition: opacity 0.3s, background 0.3s;
}

.mvf-schedule-item.mvf-schedule-disabled {
  opacity: 0.5;
  background: #f0f0f0;
}

.mvf-schedule-item.mvf-schedule-disabled .mvf-schedule-time,
.mvf-schedule-item.mvf-schedule-disabled .mvf-schedule-duration {
  text-decoration: line-through;
  color: #999;
}

/* Toggle Switch */
.mvf-schedule-toggle {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
  flex-shrink: 0;
}

.mvf-schedule-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.mvf-schedule-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 24px;
}

.mvf-schedule-toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.mvf-schedule-toggle input:checked + .mvf-schedule-toggle-slider {
  background-color: #2271b1;
}

.mvf-schedule-toggle input:checked + .mvf-schedule-toggle-slider:before {
  transform: translateX(26px);
}

.mvf-schedule-toggle-slider:hover {
  background-color: #999;
}

.mvf-schedule-toggle input:checked + .mvf-schedule-toggle-slider:hover {
  background-color: #135e96;
}

.mvf-schedule-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.mvf-schedule-time {
  font-size: 18px;
  font-weight: 600;
  color: #2271b1;
}

.mvf-schedule-duration {
  font-size: 14px;
  color: #666;
  margin-left: 8px;
}

.mvf-schedule-days {
  font-size: 13px;
  color: #666;
  margin-top: 4px;
}

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

.mvf-schedule-btn {
  padding: 4px 10px;
  font-size: 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.mvf-schedule-btn-edit {
  background: #2271b1;
  color: white;
}

.mvf-schedule-btn-edit:hover {
  background: #135e96;
}

.mvf-schedule-btn-delete {
  background: #dc3232;
  color: white;
}

.mvf-schedule-btn-delete:hover {
  background: #a00;
}

.mvf-schedule-overlap {
  margin-top: 8px;
  padding: 8px;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 4px;
  font-size: 12px;
  color: #856404;
}

/* Nap checkbox-ok */
.mvf-day-checkbox {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  padding: 8px 10px;
  background: #f0f0f0;
  border: 2px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.mvf-day-checkbox input {
  display: none;
}

.mvf-day-checkbox span {
  font-size: 13px;
  font-weight: 500;
  color: #666;
}

.mvf-day-checkbox input:checked + span {
  color: white;
}

.mvf-day-checkbox:has(input:checked) {
  background: #2271b1;
  border-color: #2271b1;
}

.mvf-day-checkbox:hover {
  border-color: #2271b1;
}


/* ═══════════════════════════════════════════════════════════════════════
   Napkelte/nyugta info
   ═══════════════════════════════════════════════════════════════════════ */

.mvf-sun-info {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 15px 0;
  padding: 12px;
  background: #f0f8ff;
  border: 1px solid #d0e7ff;
  border-radius: 6px;
}

.mvf-sun-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mvf-sun-icon {
  font-size: 20px;
}

.mvf-sun-label {
  font-size: 13px;
  color: #666;
}

.mvf-sun-time {
  font-size: 16px;
  font-weight: 600;
  color: #2271b1;
  margin-left: auto;
}
