/* Transparenz-Hub Custom Styles */

/* Base styles */
* {
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

/* Line clamp utility */
.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}

/* Focus styles */
input:focus,
textarea:focus,
select:focus,
button:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

/* Animation for status badges */
@keyframes pulse-slow {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.animate-pulse-slow {
  animation: pulse-slow 2s ease-in-out infinite;
}

/* Card hover effects */
.card-hover {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* Signature animation */
@keyframes sign {
  from {
    stroke-dashoffset: 100;
  }
  to {
    stroke-dashoffset: 0;
  }
}

.signature-animated {
  stroke-dasharray: 100;
  animation: sign 1s ease forwards;
}

/* Loading spinner */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* PWA Install Banner */
.pwa-install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
  color: white;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1000;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
}

.pwa-install-banner.hidden {
  display: none;
}

/* Mobile optimizations */
@media (max-width: 640px) {
  body {
    font-size: 14px;
  }
  
  .modal-content {
    margin: 1rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
  }
  
  /* Bottom safe area for PWA */
  .safe-area-bottom {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* Print styles */
@media print {
  nav,
  button,
  .no-print {
    display: none !important;
  }
  
  body {
    background: white !important;
  }
  
  .shadow-md,
  .shadow-lg {
    box-shadow: none !important;
    border: 1px solid #e5e7eb;
  }
}

/* Escrow status indicator */
.escrow-deposited {
  position: relative;
}

.escrow-deposited::after {
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  background: #10b981;
  border-radius: 50%;
  border: 2px solid white;
}

/* Audit log timeline */
.audit-timeline {
  position: relative;
}

.audit-timeline::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 40px;
  bottom: 0;
  width: 2px;
  background: #e5e7eb;
}

.audit-timeline > div:last-child::before {
  display: none;
}

/* Status colors with gradients */
.status-active {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

.status-completed {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
}

.status-disputed {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
}

/* Photo upload preview */
.photo-preview-container {
  position: relative;
  display: inline-block;
}

.photo-preview-container .remove-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  background: #ef4444;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Geo tag indicator */
.geo-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: #f3f4f6;
  border-radius: 9999px;
  font-size: 12px;
  color: #6b7280;
}

.geo-tag i {
  color: #ef4444;
}

/* Briefing lock indicator */
.briefing-locked {
  position: relative;
}

.briefing-locked::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(16, 185, 129, 0.05) 10px,
    rgba(16, 185, 129, 0.05) 20px
  );
  pointer-events: none;
  border-radius: inherit;
}

/* Hash chain visualization */
.hash-chain {
  font-family: 'Courier New', monospace;
  font-size: 10px;
  color: #9ca3af;
  word-break: break-all;
}

/* Integrity verified badge */
.integrity-verified {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
}

/* Change request impact indicators */
.impact-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

.impact-time {
  background: #fef3c7;
  color: #92400e;
}

.impact-budget {
  background: #fce7f3;
  color: #9d174d;
}

/* Role badges */
.role-ag {
  background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
  color: white;
}

.role-dl {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  color: white;
}

/* Empty state illustration */
.empty-state {
  padding: 3rem;
  text-align: center;
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1rem;
  background: #f3f4f6;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-state-icon i {
  font-size: 2rem;
  color: #9ca3af;
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s ease-in-out infinite;
}

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

/* Toast animations */
.toast-enter {
  animation: toast-in 0.3s ease forwards;
}

.toast-exit {
  animation: toast-out 0.3s ease forwards;
}

@keyframes toast-in {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes toast-out {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(100%);
    opacity: 0;
  }
}
