/* =====================================================
   filEZ v1.0.0
   -----------------------------------------------------
   Global Styles
   ===================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;

  --secondary: #f3f4f6;

  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;

  --background: #f8fafc;

  --surface: #ffffff;

  --border: #e5e7eb;

  --text: #111827;
  --text-light: #6b7280;

  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);

  --radius: 18px;

  --transition: 0.25s ease;

  --max-width: 520px;
}

html {
  font-size: 16px;
}

body {
  font-family: "Inter", sans-serif;

  background: linear-gradient(135deg, #eef2ff, #f8fafc);

  color: var(--text);

  min-height: 100vh;

  display: flex;

  justify-content: center;

  align-items: center;

  padding: 24px;
}

/* =====================================================
   APP
   ===================================================== */

#app {
  width: 100%;

  max-width: var(--max-width);
}

/* =====================================================
   SCREEN
   ===================================================== */

.screen {
  display: flex;

  flex-direction: column;

  gap: 24px;
}

/* =====================================================
   LOGO
   ===================================================== */

.logo {
  text-align: center;

  font-size: 40px;

  font-weight: 700;

  color: var(--primary);
}

.subtitle {
  text-align: center;

  color: var(--text-light);

  margin-top: -12px;
}

.title {
  text-align: center;

  font-size: 28px;

  font-weight: 700;
}

/* =====================================================
   CARD
   ===================================================== */

.card {
  background: rgba(255, 255, 255, 0.9);

  backdrop-filter: blur(20px);

  border-radius: var(--radius);

  border: 1px solid rgba(255, 255, 255, 0.7);

  padding: 28px;

  box-shadow: var(--shadow);

  display: flex;

  flex-direction: column;

  gap: 18px;
}

/* =====================================================
   TEXT
   ===================================================== */

.label {
  font-size: 14px;

  color: var(--text-light);

  font-weight: 600;
}

.status {
  text-align: center;

  color: var(--text-light);

  font-size: 14px;
}

.footer {
  text-align: center;

  color: var(--text-light);

  font-size: 13px;
}

/* =====================================================
   LINKS
   ===================================================== */

a {
  color: var(--primary);

  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* =====================================================
   HR
   ===================================================== */

hr {
  border: none;

  border-top: 1px solid var(--border);
}

/* =====================================================
   SPACING HELPERS
   ===================================================== */

.mt-8 {
  margin-top: 8px;
}

.mt-16 {
  margin-top: 16px;
}

.mt-24 {
  margin-top: 24px;
}

.mb-8 {
  margin-bottom: 8px;
}

.mb-16 {
  margin-bottom: 16px;
}

.center {
  text-align: center;
}

/* =====================================================
   CODE DISPLAY
   ===================================================== */

.code {
  width: 100%;

  padding: 16px;

  border-radius: 14px;

  border: 2px dashed var(--primary);

  background: #eef2ff;

  color: var(--primary);

  font-size: 22px;

  text-align: center;

  font-weight: 700;

  letter-spacing: 2px;
}

/* =====================================================
   EMPTY
   ===================================================== */

.empty {
  text-align: center;

  color: var(--text-light);

  padding: 30px 0;
}

/* =====================================================
   BUTTONS
   ===================================================== */

button {
  width: 100%;

  border: none;

  border-radius: 14px;

  padding: 16px;

  font-size: 16px;

  font-weight: 600;

  cursor: pointer;

  transition: all var(--transition);
}

.primary {
  background: var(--primary);

  color: #fff;
}

.primary:hover {
  background: var(--primary-hover);

  transform: translateY(-2px);

  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
}

.primary:active {
  transform: scale(0.98);
}

.secondary {
  background: var(--secondary);

  color: var(--text);
}

.secondary:hover {
  background: #e5e7eb;
}

button:disabled {
  background: #d1d5db;

  color: #9ca3af;

  cursor: not-allowed;

  transform: none;

  box-shadow: none;
}

/* =====================================================
   FILE PICKER
   ===================================================== */

.file-picker {
  width: 100%;

  border: 2px dashed var(--primary);

  border-radius: 16px;

  background: #eef2ff;

  color: var(--primary);

  text-align: center;

  padding: 40px 20px;

  cursor: pointer;

  font-weight: 600;

  transition: all var(--transition);

  user-select: none;
}

.file-picker:hover {
  background: #e0e7ff;

  transform: translateY(-2px);
}

/* =====================================================
   INPUTS
   ===================================================== */

input[type="text"],
input[type="password"],
input[type="number"],
input[type="search"] {
  width: 100%;

  padding: 16px;

  border-radius: 14px;

  border: 1px solid var(--border);

  outline: none;

  font-size: 16px;

  transition: border var(--transition);
}

input:focus {
  border-color: var(--primary);
}

/* =====================================================
   FILE LIST
   ===================================================== */

.file-list {
  display: flex;

  flex-direction: column;

  gap: 12px;

  max-height: 320px;

  overflow-y: auto;
}

/* =====================================================
   FILE ITEM
   ===================================================== */

.file-item {
  display: flex;

  align-items: center;

  gap: 14px;

  padding: 14px;

  background: #f9fafb;

  border-radius: 14px;

  border: 1px solid var(--border);

  transition: all var(--transition);
}

.file-item:hover {
  background: #eef2ff;

  border-color: var(--primary);
}

/* =====================================================
   SELECTABLE FILES
   ===================================================== */

.file-item.selectable {
  cursor: pointer;
}

.file-item.selectable input {
  margin-right: 8px;
}

/* =====================================================
   FILE ICON
   ===================================================== */

.file-icon {
  font-size: 28px;

  width: 42px;

  display: flex;

  justify-content: center;

  align-items: center;
}

/* =====================================================
   FILE INFO
   ===================================================== */

.file-info {
  flex: 1;

  min-width: 0;
}

.file-name {
  font-weight: 600;

  overflow: hidden;

  text-overflow: ellipsis;

  white-space: nowrap;
}

.file-size {
  font-size: 13px;

  color: var(--text-light);

  margin-top: 4px;
}

/* =====================================================
   CHECKBOX
   ===================================================== */

.download-file {
  width: 18px;

  height: 18px;

  cursor: pointer;
}

/* =====================================================
   PROGRESS
   ===================================================== */

.progress {
  width: 100%;

  height: 14px;

  background: #e5e7eb;

  border-radius: 999px;

  overflow: hidden;
}

.progress-fill {
  width: 0%;

  height: 100%;

  background: linear-gradient(90deg, var(--primary), #6366f1);

  transition: width 0.2s linear;
}

/* =====================================================
   PROGRESS TEXT
   ===================================================== */

.progress-text {
  text-align: center;

  font-size: 24px;

  font-weight: 700;
}

/* =====================================================
   STATUS
   ===================================================== */

.status {
  text-align: center;

  color: var(--text-light);
}

/* =====================================================
   BADGES
   ===================================================== */

.badge {
  display: inline-flex;

  align-items: center;

  justify-content: center;

  padding: 6px 12px;

  border-radius: 999px;

  font-size: 12px;

  font-weight: 600;
}

.badge-success {
  background: #dcfce7;

  color: #166534;
}

.badge-warning {
  background: #fef3c7;

  color: #92400e;
}

.badge-danger {
  background: #fee2e2;

  color: #991b1b;
}

/* =====================================================
   SCROLLBAR
   ===================================================== */

.file-list::-webkit-scrollbar {
  width: 8px;
}

.file-list::-webkit-scrollbar-track {
  background: transparent;
}

.file-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;

  border-radius: 999px;
}

.file-list::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 600px) {
  body {
    padding: 16px;

    align-items: flex-start;
  }

  .screen {
    gap: 18px;
  }

  .card {
    padding: 20px;
  }

  .logo {
    font-size: 34px;
  }

  .title {
    font-size: 24px;
  }

  button {
    padding: 15px;
  }

  .code {
    font-size: 18px;

    letter-spacing: 1px;
  }

  .file-picker {
    padding: 30px 15px;
  }
}

/* =====================================================
   LARGE SCREENS
   ===================================================== */

@media (min-width: 900px) {
  #app {
    max-width: 620px;
  }
}

/* =====================================================
   FADE ANIMATION
   ===================================================== */

@keyframes fadeIn {
  from {
    opacity: 0;

    transform: translateY(10px);
  }

  to {
    opacity: 1;

    transform: translateY(0);
  }
}

.screen {
  animation: fadeIn 0.25s ease;
}

/* =====================================================
   SPINNER
   ===================================================== */

.spinner {
  width: 40px;

  height: 40px;

  margin: 0 auto;

  border: 4px solid #e5e7eb;

  border-top-color: var(--primary);

  border-radius: 50%;

  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* =====================================================
   TOAST
   ===================================================== */

.toast {
  position: fixed;

  left: 50%;

  bottom: 24px;

  transform: translateX(-50%);

  background: #111827;

  color: white;

  padding: 14px 22px;

  border-radius: 12px;

  box-shadow: var(--shadow);

  z-index: 1000;

  opacity: 0;

  pointer-events: none;

  transition: opacity 0.25s ease;
}

.toast.show {
  opacity: 1;
}

/* =====================================================
   DROP ZONE
   ===================================================== */

.drop-active {
  border-color: var(--success);

  background: #dcfce7;

  color: #166534;
}

/* =====================================================
   FILE ITEM STATES
   ===================================================== */

.file-item.selected {
  border-color: var(--primary);

  background: #eef2ff;
}

.file-item.completed {
  border-color: var(--success);

  background: #dcfce7;
}

.file-item.error {
  border-color: var(--danger);

  background: #fee2e2;
}

/* =====================================================
   PROGRESS STATES
   ===================================================== */

.progress.complete .progress-fill {
  background: linear-gradient(90deg, var(--success), #4ade80);
}

.progress.error .progress-fill {
  background: linear-gradient(90deg, var(--danger), #f87171);
}

/* =====================================================
   HOVER EFFECTS
   ===================================================== */

.card {
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-2px);

  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.1);
}

/* =====================================================
   FOCUS
   ===================================================== */

button:focus-visible,
input:focus-visible,
.file-picker:focus-visible {
  outline: 3px solid rgba(79, 70, 229, 0.35);

  outline-offset: 2px;
}

/* =====================================================
   TEXT SELECTION
   ===================================================== */

::selection {
  background: #c7d2fe;

  color: #111827;
}

/* =====================================================
   UTILITIES
   ===================================================== */

.hidden {
  display: none !important;
}

.w-100 {
  width: 100%;
}

.flex {
  display: flex;
}

.flex-column {
  flex-direction: column;
}

.align-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.gap-8 {
  gap: 8px;
}

.gap-12 {
  gap: 12px;
}

.gap-16 {
  gap: 16px;
}

.gap-24 {
  gap: 24px;
}

/* =====================================================
   ACCESSIBILITY
   ===================================================== */

button,
input,
label {
  -webkit-tap-highlight-color: transparent;
}

button {
  touch-action: manipulation;
}

/* =====================================================
   PRINT
   ===================================================== */

@media print {
  body {
    background: white;
  }

  .card {
    box-shadow: none;

    border: 1px solid #ccc;
  }
}

/* =====================================================
   END
   ===================================================== */
