/* ============================================================================
   ÉNORME ENVOI — Design Identity (CSS)
   Theme: Midnight Neon Violet & Retro Gaming
   ============================================================================ */

:root {
  --color-bg-dark: #0a0c16;
  --color-card-bg: rgba(18, 22, 40, 0.75);
  --color-border: rgba(139, 92, 246, 0.25);
  --color-primary: #8b5cf6;
  --color-primary-glow: rgba(139, 92, 246, 0.4);
  --color-secondary: #06b6d4;
  --color-secondary-glow: rgba(6, 182, 212, 0.4);
  --color-accent-pink: #ec4899;
  --color-text-main: #f3f4f6;
  --color-text-muted: #9ca3af;
  --color-success: #10b981;
  --font-title: 'Press Start 2P', monospace;
  --font-body: 'Outfit', sans-serif;
  --font-mono: 'Fira Code', monospace;
  --radius-lg: 16px;
  --radius-md: 10px;
}

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

body {
  background-color: var(--color-bg-dark);
  color: var(--color-text-main);
  font-family: var(--font-body);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  overflow-x: hidden;
  position: relative;
  /* Smooth transition for black and white to color bloom */
  transition: filter 1.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Grayscale Mode for Initial State */
body.grayscale-mode {
  filter: grayscale(100%) contrast(1.05);
}

/* Glowing cyber-grid background */
.glow-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background:
    radial-gradient(circle at 50% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(6, 182, 212, 0.1) 0%, transparent 40%);
  background-size: cover;
  pointer-events: none;
}

.app-container {
  width: 100%;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Header & 8-bit Cat Logo */
.main-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.logo-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.cat-logo {
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform: scale(var(--cat-scale, 1));
  filter: drop-shadow(0 0 8px var(--color-primary-glow));
}

.cat-logo svg {
  display: block;
}

.brand-title {
  font-family: var(--font-title);
  font-size: 1.6rem;
  letter-spacing: -1px;
  color: #ffffff;
  text-shadow: 0 0 15px var(--color-primary-glow);
  margin-top: 8px;
}

.brand-subtitle {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  max-width: 480px;
  line-height: 1.5;
}

/* Main Premium Glassmorphism Card */
.main-card {
  background-color: var(--color-card-bg);
  border: 1px solid var(--color-border);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(139, 92, 246, 0.1);
  border-radius: var(--radius-lg);
  padding: 32px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  min-height: 250px;
  position: relative;
  overflow: hidden;
}

/* Navigation tabs */
.action-tabs {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-family: var(--font-title);
  font-size: 0.65rem;
  cursor: pointer;
  padding: 8px 12px;
  transition: all 0.2s ease;
  border-radius: var(--radius-md);
}

.tab-btn.active {
  color: #ffffff;
  background-color: rgba(139, 92, 246, 0.2);
  text-shadow: 0 0 8px var(--color-primary-glow);
  box-shadow: inset 0 0 6px var(--color-primary-glow);
}

.tab-btn.logout-link:hover {
  color: var(--color-accent-pink);
  background-color: rgba(236, 72, 153, 0.1);
}

/* Views & animation hidden classes */
.view {
  transition: opacity 0.3s ease;
}

.hidden {
  display: none !important;
}

/* Forms & inputs */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-wrapper label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-main);
  letter-spacing: 0.5px;
}

input[type='text'],
input[type='password'],
textarea,
select {
  width: 100%;
  background-color: rgba(10, 12, 22, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  outline: none;
}

input[type='text']:focus,
input[type='password']:focus,
textarea:focus,
select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
  background-color: rgba(10, 12, 22, 0.8);
}

textarea {
  min-height: 120px;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.5;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%239ca3af'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 24px;
}

.help-text {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* File Drag & Drop Upload Area */
.file-upload-section {
  border: 1px dashed var(--color-border);
  padding: 12px;
  border-radius: var(--radius-lg);
  background-color: rgba(255, 255, 255, 0.02);
  transition: all 0.25s ease-in-out;
}

.file-upload-section:hover {
  border-color: var(--color-primary);
}

.file-upload-section.drag-over {
  border-color: var(--color-secondary);
  background-color: rgba(6, 182, 212, 0.08);
  box-shadow:
    0 0 15px rgba(6, 182, 212, 0.2),
    inset 0 0 15px rgba(6, 182, 212, 0.1);
  transform: scale(1.01);
}

.drop-zone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px;
  text-align: center;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.drop-zone-icon {
  font-size: 1.6rem;
  animation: floatIcon 2.5s infinite ease-in-out;
}

.drop-zone-text {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  font-weight: 400;
}

@keyframes floatIcon {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  max-height: 160px;
  overflow-y: auto;
}

.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.3);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.file-item-name {
  font-family: var(--font-mono);
  color: var(--color-text-main);
  word-break: break-all;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 80%;
}

.file-item-remove {
  color: var(--color-accent-pink);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-title);
  font-size: 0.65rem;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.file-item-remove:hover {
  background-color: rgba(236, 72, 153, 0.1);
  text-shadow: 0 0 5px var(--color-accent-pink);
}

/* Switch styling */
.checkbox-wrapper {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  margin: 4px 0;
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: 0.3s;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.slider:before {
  position: absolute;
  content: '';
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: var(--color-text-muted);
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--color-primary-glow);
  border-color: var(--color-primary);
}

input:checked + .slider:before {
  transform: translateX(24px);
  background-color: var(--color-primary);
  box-shadow: 0 0 8px var(--color-primary);
}

.switch-label {
  cursor: pointer;
  user-select: none;
  font-size: 0.95rem !important;
}

/* Buttons */
.btn {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, #6d28d9 100%);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.btn-primary:hover {
  box-shadow:
    0 4px 20px rgba(139, 92, 246, 0.6),
    0 0 15px rgba(139, 92, 246, 0.2);
  filter: brightness(1.1);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Section typography */
.section-title {
  font-family: var(--font-title);
  font-size: 0.85rem;
  color: #ffffff;
  margin-bottom: 12px;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

.section-desc {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

/* Success & Error Banners */
.success-banner {
  color: var(--color-success);
  background-color: rgba(16, 185, 129, 0.1);
  border-left: 3px solid var(--color-success);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  text-shadow: 0 0 5px rgba(16, 185, 129, 0.3);
}

.error-msg {
  color: var(--color-accent-pink);
  font-size: 0.9rem;
  background-color: rgba(236, 72, 153, 0.1);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border-left: 3px solid var(--color-accent-pink);
}

/* Success layout */
.success-icon {
  font-size: 3rem;
  text-align: center;
  margin-bottom: 16px;
  animation: bounce 1.5s infinite;
}

.link-share-box {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.link-share-box input {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background-color: rgba(0, 0, 0, 0.4);
}

.warning-box {
  background-color: rgba(6, 182, 212, 0.08);
  border-left: 3px solid var(--color-secondary);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.warn-icon {
  color: var(--color-secondary);
  font-weight: bold;
  font-size: 1.2rem;
}

.warn-text {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.4;
}

/* Loading animations & progress */
.progress-container {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-bar-wrapper {
  width: 100%;
  height: 12px;
  background-color: rgba(0, 0, 0, 0.4);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  transition: width 0.1s ease;
  box-shadow: 0 0 10px var(--color-primary-glow);
}

.progress-text {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  text-align: center;
}

.spinner-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 40px 0;
}

.pixel-spinner {
  width: 32px;
  height: 32px;
  border: 4px solid var(--color-primary-glow);
  border-top-color: var(--color-secondary);
  animation: spin 1s infinite linear;
}

.loading-text {
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

/* Message View Display Box */
.message-display-box {
  background-color: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 20px;
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 20px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
}

.message-display-box pre {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
  color: #ffffff;
}

/* Decrypted Files Attachments Cards */
.decrypted-files-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 12px;
}

@media (min-width: 480px) {
  .decrypted-files-list {
    grid-template-columns: 1fr 1fr;
  }
}

.file-card {
  background-color: rgba(10, 12, 22, 0.4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.file-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.15);
}

.file-card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.file-card-name {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  word-break: break-all;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-card-size {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* Media previews E2EE */
.media-preview {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background-color: #000;
}

video.media-preview {
  background-color: #000;
}

.file-card .btn {
  font-size: 0.8rem;
  padding: 8px 12px;
  margin-top: auto;
  width: 100%;
}

/* Footer styling */
.main-footer {
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.security-note {
  font-size: 0.75rem;
  max-width: 550px;
  margin: 0 auto;
  line-height: 1.4;
  opacity: 0.7;
}

/* Keyframes & Animations */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* Scrollbar customizations */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Subtle corner decoration */
body::after {
  content: '🐾';
  position: fixed;
  right: 16px;
  bottom: 12px;
  font-size: 24px;
  opacity: 0.16;
  pointer-events: none;
  z-index: 10;
}
