/**
 * TimeRec Frontend Styles
 * Mobile-First Design
 */

/* Reset und Basis */
.timerec-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
    Cantarell, sans-serif;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

/* Header */
.timerec-header {
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #f0f0f0;
}

.timerec-header h2 {
  margin: 0;
  font-size: 28px;
  color: #333;
  font-weight: 600;
}

/* Status Badge */
.timerec-status {
  text-align: center;
  margin-bottom: 25px;
}

.timerec-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.timerec-status-badge.active {
  background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
  color: white;
}

.timerec-status-badge.inactive {
  background: #f5f5f5;
  color: #666;
}

.status-icon {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.timerec-status-badge.active .status-icon {
  background: white;
}

.timerec-status-badge.inactive .status-icon {
  background: #999;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Messages */
.timerec-messages {
  margin-bottom: 20px;
}

.timerec-message {
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 10px;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.timerec-message.success {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}

.timerec-message.error {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}

.timerec-error {
  padding: 20px;
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 8px;
  color: #856404;
  text-align: center;
}

/* Form */
.timerec-form {
  margin-bottom: 20px;
}

.timerec-form-group {
  margin-bottom: 20px;
}

.timerec-form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
  font-size: 16px;
}

.timerec-form-group .required {
  color: #dc3545;
}

.timerec-input,
.timerec-select {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  transition: all 0.3s ease;
  box-sizing: border-box;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.timerec-input:focus,
.timerec-select:focus {
  outline: none;
  border-color: #0055af;
  box-shadow: 0 0 0 3px rgba(0, 85, 175, 0.1);
}

.timerec-help {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  color: #666;
}

/* Buttons - Mit spezifizierten Farben */
.timerec-btn {
  width: 100%;
  padding: 16px 24px;
  font-size: 18px;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 15px;
  min-height: 56px; /* Touch-optimiert */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.timerec-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.timerec-btn:active {
  transform: translateY(0);
}

.timerec-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-icon {
  font-size: 20px;
}

/* Arbeitsbeginn Button - Blau #0055AF */
.timerec-btn-start-work {
  background: linear-gradient(135deg, #0055af 0%, #003d7a 100%);
  color: white;
}

.timerec-btn-start-work:hover {
  background: linear-gradient(135deg, #004a99 0%, #003366 100%);
}

/* Start Pause Button - Grün */
.timerec-btn-start-break {
  background: linear-gradient(135deg, #28a745 0%, #218838 100%);
  color: white;
}

.timerec-btn-start-break:hover {
  background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
}

/* Ende Pause Button - Orange */
.timerec-btn-end-break {
  background: linear-gradient(135deg, #fd7e14 0%, #e8590c 100%);
  color: white;
}

.timerec-btn-end-break:hover {
  background: linear-gradient(135deg, #e8590c 0%, #d9534f 100%);
}

/* Arbeitsende Button - Rot */
.timerec-btn-end-work {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  color: white;
}

.timerec-btn-end-work:hover {
  background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
}

/* Active Tracking */
.timerec-active-tracking {
  padding: 20px 0;
}

.timerec-info-box {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 25px;
}

.timerec-info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #e9ecef;
}

.timerec-info-item:last-child {
  border-bottom: none;
}

.timerec-label {
  font-weight: 600;
  color: #555;
  font-size: 15px;
}

.timerec-value {
  font-size: 16px;
  color: #333;
  font-weight: 500;
}

.timerec-current-time .timerec-value {
  font-size: 24px;
  font-weight: 700;
  color: #0055af;
}

.timerec-time-display {
  font-variant-numeric: tabular-nums;
}

/* Break Controls */
.timerec-break-controls {
  margin-bottom: 20px;
}

.timerec-notice {
  text-align: center;
  padding: 12px;
  background: #fff3cd;
  border-radius: 8px;
  color: #856404;
  font-weight: 500;
}

.timerec-warning {
  text-align: center;
  color: #856404;
  background: #fff3cd;
  padding: 12px;
  border-radius: 8px;
  margin-top: 15px;
}

/* Today Summary */
.timerec-today-summary {
  margin-top: 30px;
  padding-top: 25px;
  border-top: 2px solid #f0f0f0;
}

.timerec-today-summary h3 {
  margin: 0 0 15px 0;
  font-size: 20px;
  color: #333;
}

.timerec-summary-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 15px;
}

.timerec-summary-item .label {
  color: #666;
}

.timerec-summary-item .value {
  font-weight: 600;
  color: #333;
}

/* Footer */
.timerec-footer {
  margin-top: 25px;
  text-align: center;
}

.timerec-link {
  display: inline-block;
  padding: 10px 20px;
  color: #0055af;
  text-decoration: none;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.timerec-link:hover {
  background: #f0f7ff;
  color: #003d7a;
}

/* Loading State */
.timerec-btn.loading {
  position: relative;
  color: transparent;
}

.timerec-btn.loading::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin-left: -10px;
  margin-top: -10px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Tablet */
@media (min-width: 768px) {
  .timerec-container {
    padding: 30px;
  }

  .timerec-header h2 {
    font-size: 32px;
  }

  .timerec-btn {
    font-size: 20px;
    padding: 18px 28px;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .timerec-container {
    padding: 40px;
  }

  .timerec-break-controls {
    display: flex;
    gap: 15px;
  }

  .timerec-break-controls .timerec-btn {
    flex: 1;
    margin-bottom: 0;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .timerec-container {
    background: #1e1e1e;
    color: #e0e0e0;
  }

  .timerec-header h2,
  .timerec-label,
  .timerec-value,
  .timerec-today-summary h3 {
    color: #e0e0e0;
  }

  .timerec-info-box {
    background: #2a2a2a;
  }

  .timerec-input,
  .timerec-select {
    background: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
  }

  .timerec-status-badge.inactive {
    background: #2a2a2a;
    color: #aaa;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print */
@media print {
  .timerec-btn,
  .timerec-form,
  .timerec-footer {
    display: none;
  }
}
