/* ============================================================================
   styles.css — odpowiednik klas Tailwind użytych w wersji React/TSX.
   Zachowane 1:1: kolory (paleta slate/blue), odstępy, cienie, animacje.
   ========================================================================= */

/* --------------------------------------------------------------- reset ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  border: 0 solid #e5e7eb;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif,
    'Apple Color Emoji', 'Segoe UI Emoji';
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
p {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
}

button {
  font-family: inherit;
  font-size: 100%;
  line-height: inherit;
  color: inherit;
  margin: 0;
  padding: 0;
  background-color: transparent;
  background-image: none;
  cursor: pointer;
}

input {
  font-family: inherit;
  font-size: 100%;
  line-height: inherit;
  color: inherit;
  margin: 0;
}

svg {
  display: block;
  vertical-align: middle;
}

[hidden] {
  display: none !important;
}

/* ------------------------------------------------------------- ikony ------ */
/* odpowiednik ikon lucide-react (stroke 2, viewBox 24) */
.icon {
  flex-shrink: 0;
}

/* --------------------------------------------------------------- App ------ */
/* min-h-screen bg-gradient-to-b from-slate-50 to-slate-100 flex flex-col */
.app {
  min-height: 100vh;
  background-image: linear-gradient(to bottom, #f8fafc, #f1f5f9);
  display: flex;
  flex-direction: column;
}

/* ------------------------------------------------------------ Header ------ */
/* py-6 px-4 sm:px-6 flex justify-center border-b border-slate-200
   bg-white/80 backdrop-blur-sm sticky top-0 z-10 */
.header {
  padding: 1.5rem 1rem;
  display: flex;
  justify-content: center;
  border-bottom: 1px solid #e2e8f0;
  background-color: rgba(255, 255, 255, 0.8);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  position: sticky;
  top: 0;
  z-index: 10;
}

@media (min-width: 640px) {
  .header {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

/* flex items-center space-x-2 */
.header-inner {
  display: flex;
  align-items: center;
}

.header-inner > * + * {
  margin-left: 0.5rem;
}

/* h-6 w-6 text-blue-600 */
.header-icon {
  height: 1.5rem;
  width: 1.5rem;
  color: #2563eb;
}

/* text-xl font-semibold text-slate-800 */
.header-title {
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 600;
  color: #1e293b;
}

/* -------------------------------------------------------------- Main ------ */
/* flex-1 flex items-center justify-center p-4 */
.main {
  flex: 1 1 0%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* ----------------------------------------------------- QRCodeGenerator ---- */
/* w-full max-w-md mx-auto */
.generator {
  width: 100%;
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
}

/* bg-white rounded-xl shadow-lg overflow-hidden transition-all duration-300
   transform hover:shadow-xl */
.card {
  background-color: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 300ms;
  transform: translate(0, 0);
}

.card:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* p-6 */
.card-body {
  padding: 1.5rem;
}

/* text-xl font-medium text-slate-800 mb-4 */
.card-title {
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 500;
  color: #1e293b;
  margin-bottom: 1rem;
}

/* --------------------------------------------------------- InputField ----- */
/* relative */
.input-field {
  position: relative;
}

/* absolute left-3 transition-all duration-200 pointer-events-none
   + stan domyślny: text-sm translate-y-3 text-slate-500 */
.input-label {
  position: absolute;
  left: 0.75rem;
  top: 0;
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 200ms;
  pointer-events: none;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: #64748b;
  transform: translateY(0.75rem);
}

/* stan aktywny (focus lub niepusta wartość): text-xs -translate-y-2 text-blue-600 */
.input-label.is-active {
  font-size: 0.75rem;
  line-height: 1rem;
  color: #2563eb;
  transform: translateY(-0.5rem);
}

/* w-full px-3 pt-6 pb-2 rounded-lg border transition-all duration-200 outline-none
   + border-slate-300 hover:border-slate-400 */
.input-control {
  width: 100%;
  padding: 1.5rem 0.75rem 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid #cbd5e1;
  background-color: #ffffff;
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 200ms;
  outline: 2px solid transparent;
  outline-offset: 2px;
  font-size: 1rem;
  line-height: 1.5rem;
}

.input-control:hover {
  border-color: #94a3b8;
}

/* focus: border-blue-500 shadow-sm ring-2 ring-blue-100 */
.input-control:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px #dbeafe, 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* absolute right-3 top-1/2 -translate-y-1/2 text-slate-400
   hover:text-slate-600 transition-colors duration-200 */
.clear-button {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  transition-property: color;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 200ms;
  display: flex;
}

.clear-button:hover {
  color: #475569;
}

/* h-5 w-5 */
.clear-icon {
  height: 1.25rem;
  width: 1.25rem;
}

/* ------------------------------------------------------ podgląd kodu QR --- */
/* mt-8 mb-6 */
.qr-section {
  margin-top: 2rem;
  margin-bottom: 1.5rem;
}

/* flex justify-center items-center p-4 bg-slate-50 rounded-lg
   border border-slate-200 transition-all duration-300 */
.qr-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  background-color: #f8fafc;
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0;
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 300ms;
  opacity: 1;
}

/* brak tekstu -> opacity-50 */
.qr-container.is-empty {
  opacity: 0.5;
}

/* p-2 bg-white rounded-md shadow-sm */
.qr-canvas-holder {
  padding: 0.5rem;
  background-color: #ffffff;
  border-radius: 0.375rem;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* transition-all duration-300 (na elemencie canvas) */
.qr-canvas {
  display: block;
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 300ms;
}

/* flex flex-col items-center justify-center h-[232px] w-[232px] text-slate-400 */
.qr-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 232px;
  width: 232px;
  color: #94a3b8;
}

/* h-8 w-8 mb-2 opacity-50 */
.qr-placeholder-icon {
  height: 2rem;
  width: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

/* text-sm */
.qr-placeholder-text {
  font-size: 0.875rem;
  line-height: 1.25rem;
}

/* ------------------------------------------------------ przycisk pobrania - */
/* w-full py-3 px-4 rounded-lg flex items-center justify-center space-x-2
   text-white font-medium transition-all duration-300
   + stan nieaktywny: bg-slate-300 cursor-not-allowed */
.download-button {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 500;
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 300ms;
  background-color: #cbd5e1;
  cursor: not-allowed;
}

.download-button > * + * {
  margin-left: 0.5rem;
}

/* jest tekst -> bg-blue-600 hover:bg-blue-700 */
.download-button.is-active {
  background-color: #2563eb;
  cursor: pointer;
}

.download-button.is-active:hover {
  background-color: #1d4ed8;
}

/* focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 */
.download-button:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #3b82f6;
}

/* h-5 w-5 */
.download-icon {
  height: 1.25rem;
  width: 1.25rem;
}

/* animate-bounce w trakcie pobierania */
.download-icon.is-bouncing {
  animation: bounce 1s infinite;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(-25%);
    animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
  }
  50% {
    transform: none;
    animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
  }
}

/* ------------------------------------------------------------- Footer ----- */
/* py-4 px-4 text-center text-sm text-slate-500 border-t border-slate-200
   bg-white/80 backdrop-blur-sm */
.footer {
  padding: 1rem;
  text-align: center;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: #64748b;
  border-top: 1px solid #e2e8f0;
  background-color: rgba(255, 255, 255, 0.8);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
