/**
 * Utility Styles - Hilfsklassen
 * Time Tracker v2
 */

/* ========================================
   Sichtbarkeit
   ======================================== */

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.invisible {
  visibility: hidden;
}

/* ========================================
   Loading Screen
   ======================================== */

.loading-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  color: var(--text-muted);
}

/* ========================================
   Text Utilities
   ======================================== */

.text-center {
  text-align: center;
}
.text-left {
  text-align: left;
}
.text-right {
  text-align: right;
}

.text-primary {
  color: var(--text-primary);
}
.text-secondary {
  color: var(--text-secondary);
}
.text-muted {
  color: var(--text-muted);
}
.text-success {
  color: var(--color-success);
}
.text-danger {
  color: var(--color-danger);
}
.text-warning {
  color: var(--color-warning);
}

.font-bold {
  font-weight: 600;
}
.font-normal {
  font-weight: 400;
}

/* ========================================
   Spacing Utilities
   ======================================== */

.mt-1 {
  margin-top: var(--space-1);
}
.mt-2 {
  margin-top: var(--space-2);
}
.mt-4 {
  margin-top: var(--space-4);
}
.mt-6 {
  margin-top: var(--space-6);
}
.mt-8 {
  margin-top: var(--space-8);
}

.mb-1 {
  margin-bottom: var(--space-1);
}
.mb-2 {
  margin-bottom: var(--space-2);
}
.mb-4 {
  margin-bottom: var(--space-4);
}
.mb-6 {
  margin-bottom: var(--space-6);
}
.mb-8 {
  margin-bottom: var(--space-8);
}

.p-2 {
  padding: var(--space-2);
}
.p-4 {
  padding: var(--space-4);
}
.p-6 {
  padding: var(--space-6);
}
.p-8 {
  padding: var(--space-8);
}

/* ========================================
   Flex Utilities
   ======================================== */

.flex {
  display: flex;
}
.flex-col {
  flex-direction: column;
}
.flex-wrap {
  flex-wrap: wrap;
}
.items-center {
  align-items: center;
}
.justify-center {
  justify-content: center;
}
.justify-between {
  justify-content: space-between;
}
.gap-2 {
  gap: var(--space-2);
}
.gap-4 {
  gap: var(--space-4);
}

/* ========================================
   Demo Styles (temporär für Phase 1.2)
   ======================================== */

.demo-container {
  max-width: 600px;
  margin: 0 auto;
  padding: var(--space-8);
}

.demo-section {
  margin-top: var(--space-8);
  padding: var(--space-4);
  background: var(--surface-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid var(--surface-border);
}

.demo-section h3 {
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.demo-btn {
  padding: var(--space-3) var(--space-6);
  background: var(--color-primary);
  color: var(--text-inverse);
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: background-color var(--transition-fast);
}

.demo-btn:hover {
  background: var(--color-primary-hover);
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
}

.color-box {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  color: var(--text-inverse);
  font-size: var(--text-xs);
  font-weight: 500;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.status-grid {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.status-badge {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
}

.status-working {
  background: var(--status-working-bg);
  color: var(--status-working);
}

.status-break {
  background: var(--status-break-bg);
  color: var(--status-break);
}

.status-idle {
  background: var(--status-idle-bg);
  color: var(--status-idle);
}

.phase-info {
  margin-top: var(--space-8);
  padding: var(--space-4);
  background: var(--color-success-light);
  color: var(--color-success);
  border-radius: var(--radius-md);
  text-align: center;
  font-weight: 500;
}

.demo-btn-secondary {
  background: var(--surface-border);
  color: var(--text-primary);
}

.demo-btn-secondary:hover {
  background: var(--text-muted);
  color: var(--text-inverse);
}

.btn-group {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-4);
  flex-wrap: wrap;
}

.code-block {
  background: var(--surface-bg);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

.code-block p {
  margin-bottom: var(--space-2);
  color: var(--text-primary);
}

.code-block p:last-child {
  margin-bottom: 0;
}

.code-block strong {
  color: var(--color-primary);
}

/* ========================================
   Week Grid (Demo)
   ======================================== */

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--space-2);
}

.week-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-3);
  background: var(--surface-bg);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  text-align: center;
}

.week-day-today {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
}

.week-day-weekend {
  opacity: 0.6;
}

.week-day-name {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.week-day-date {
  font-size: var(--text-sm);
  color: var(--text-primary);
  margin-top: var(--space-1);
}

.week-day-today .week-day-name,
.week-day-today .week-day-date {
  color: var(--color-primary);
}

/* ========================================
   Enhanced Typography Utilities
   ======================================== */

.text-xs {
  font-size: var(--text-xs);
}
.text-sm {
  font-size: var(--text-sm);
}
.text-base {
  font-size: var(--text-base);
}
.text-lg {
  font-size: var(--text-lg);
}
.text-xl {
  font-size: var(--text-xl);
}
.text-2xl {
  font-size: var(--text-2xl);
}
.text-3xl {
  font-size: var(--text-3xl);
}

.font-light {
  font-weight: 300;
}
.font-medium {
  font-weight: 500;
}
.font-semibold {
  font-weight: 600;
}
.font-extrabold {
  font-weight: 800;
}

.leading-tight {
  line-height: var(--leading-tight);
}
.leading-normal {
  line-height: var(--leading-normal);
}
.leading-relaxed {
  line-height: var(--leading-relaxed);
}

.tracking-tight {
  letter-spacing: -0.025em;
}
.tracking-normal {
  letter-spacing: 0;
}
.tracking-wide {
  letter-spacing: 0.025em;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ========================================
   Prose - Fließtext mit optimalem Styling
   Für längeren Content, Beschreibungen etc.
   ======================================== */

.prose {
  max-width: var(--content-max-width);
  color: var(--text-primary);
  line-height: var(--leading-body);
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

.prose h1:first-child,
.prose h2:first-child,
.prose h3:first-child,
.prose h4:first-child {
  margin-top: 0;
}

.prose p {
  margin-bottom: 1em;
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose ul,
.prose ol {
  margin-bottom: 1em;
  padding-left: 1.5em;
}

.prose ul {
  list-style: disc;
}

.prose ol {
  list-style: decimal;
}

.prose li {
  margin-bottom: 0.25em;
}

.prose strong {
  font-weight: 600;
  color: var(--text-primary);
}

.prose a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.prose a:hover {
  color: var(--color-primary-hover);
}

.prose code {
  background: var(--surface-elevated);
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
}

.prose blockquote {
  border-left: 3px solid var(--color-primary);
  padding-left: var(--space-4);
  margin: 1em 0;
  color: var(--text-secondary);
  font-style: italic;
}

/* ========================================
   Enhanced Spacing Utilities
   ======================================== */

.my-0 {
  margin-top: 0;
  margin-bottom: 0;
}
.my-2 {
  margin-top: var(--space-2);
  margin-bottom: var(--space-2);
}
.my-4 {
  margin-top: var(--space-4);
  margin-bottom: var(--space-4);
}
.my-6 {
  margin-top: var(--space-6);
  margin-bottom: var(--space-6);
}
.my-8 {
  margin-top: var(--space-8);
  margin-bottom: var(--space-8);
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.space-y-2 > * + * {
  margin-top: var(--space-2);
}
.space-y-4 > * + * {
  margin-top: var(--space-4);
}
.space-y-6 > * + * {
  margin-top: var(--space-6);
}

/* ========================================
   Border & Radius Utilities
   ======================================== */

.rounded-sm {
  border-radius: var(--radius-sm);
}
.rounded-md {
  border-radius: var(--radius-md);
}
.rounded-lg {
  border-radius: var(--radius-lg);
}
.rounded-xl {
  border-radius: var(--radius-xl);
}
.rounded-full {
  border-radius: var(--radius-full);
}

.border {
  border: 1px solid var(--surface-border);
}
.border-t {
  border-top: 1px solid var(--surface-border);
}
.border-b {
  border-bottom: 1px solid var(--surface-border);
}

/* ========================================
   Shadow Utilities
   ======================================== */

.shadow-sm {
  box-shadow: var(--shadow-sm);
}
.shadow-md {
  box-shadow: var(--shadow-md);
}
.shadow-lg {
  box-shadow: var(--shadow-lg);
}
.shadow-xl {
  box-shadow: var(--shadow-xl);
}
.shadow-none {
  box-shadow: none;
}
