/* ================================ */
/* Meus Arquivos - Layout Refinado  */
/* ================================ */

.my-files-page {
  margin-top: 86px;
  max-width: 1200px;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  gap: 24px;
  overflow: visible;
}

.my-files-hero,
.my-files-page .my-files-panel {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(255, 167, 38, 0.2);
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 249, 239, 0.9) 100%);
  box-shadow:
    0 16px 40px rgba(24, 24, 27, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.my-files-hero {
  padding: 30px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 18px;
}

.my-files-hero::before {
  content: "";
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 999px;
  top: -190px;
  right: -120px;
  background: radial-gradient(circle, rgba(255, 167, 38, 0.3) 0%, rgba(255, 167, 38, 0) 74%);
  pointer-events: none;
}

.my-files-hero-copy,
.my-files-hero-side {
  position: relative;
  z-index: 1;
}

.my-files-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 167, 38, 0.35);
  background: rgba(255, 167, 38, 0.12);
  color: #b45309;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.my-files-hero-copy h1 {
  margin: 14px 0 12px;
  color: #111827;
  font-size: clamp(2rem, 4vw, 2.85rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.my-files-hero-copy h1 span {
  background: linear-gradient(120deg, #fb8c00, #ffb74d 55%, #f97316 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.my-files-hero-copy p {
  margin: 0;
  color: #4b5563;
  line-height: 1.7;
  max-width: 58ch;
}

.my-files-hero-actions {
  margin-top: 22px;
  display: grid;
  gap: 10px;
  align-items: start;
}

.my-files-actions-cta {
  margin: 0;
  color: #64748b;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.my-files-actions-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.my-files-primary-link,
.my-files-secondary-btn {
  min-height: 48px;
  height: 48px;
  width: 200px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 11px 18px;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.my-files-primary-link {
  background: linear-gradient(135deg, #fb8c00 0%, #f97316 100%);
  color: #fff;
  box-shadow: 0 10px 24px rgba(251, 140, 0, 0.32);
}

.my-files-primary-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(251, 140, 0, 0.36);
}

.my-files-secondary-btn {
  background: rgba(255, 167, 38, 0.08);
  border-color: rgba(255, 167, 38, 0.32);
  color: #c2410c;
}

.my-files-secondary-btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 167, 38, 0.16);
}

.my-files-hero-side {
  border-radius: 16px;
  border: 1px solid rgba(251, 140, 0, 0.16);
  background: linear-gradient(165deg, #fff8ec 0%, #fff3de 100%);
  padding: 18px;
}

.my-files-hero-side h2 {
  margin: 0 0 10px;
  color: #9a3412;
  font-size: 1rem;
}

.my-files-hero-side ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.my-files-hero-side li {
  position: relative;
  padding-left: 22px;
  color: #4b5563;
  font-size: 0.93rem;
  line-height: 1.45;
}

.my-files-hero-side li::before {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  left: 0;
  top: 7px;
  background: linear-gradient(120deg, #fb8c00, #f97316);
  box-shadow: 0 0 0 4px rgba(255, 167, 38, 0.16);
}

.my-files-page .my-files-panel {
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.94)) !important;
  border: 1px solid rgba(148, 163, 184, 0.22) !important;
  padding: 24px !important;
  margin: 0 0 6px 0 !important;
  align-items: stretch !important;
  gap: 16px !important;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.76) !important;
}

.my-files-panel-head h2 {
  margin: 0;
  color: #111827 !important;
  font-size: 1.55rem !important;
  letter-spacing: -0.02em;
}

.my-files-panel-head p {
  margin: 7px 0 0;
  color: #64748b;
  line-height: 1.55;
}

.my-files-page .storage-stats {
  width: 100%;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  min-width: 0;
}

.my-files-page .storage-stats .stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.my-files-page .storage-stats .stat-item {
  min-width: 0 !important;
  align-items: flex-start !important;
  padding: 16px 18px !important;
  border-radius: 14px !important;
  border: 1px solid rgba(251, 140, 0, 0.18) !important;
  background: linear-gradient(160deg, rgba(255, 244, 229, 0.85), rgba(255, 255, 255, 0.8)) !important;
  box-shadow: none !important;
}

.my-files-page .storage-stats .stat-item strong {
  margin-bottom: 5px !important;
  font-size: clamp(1.3rem, 2.8vw, 1.9rem) !important;
  color: #c2410c !important;
}

.my-files-page .storage-stats .stat-item span {
  color: #64748b !important;
  font-size: 0.88rem !important;
}

.my-files-page .user-images-list {
  width: 100%;
  margin-top: 2px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.my-files-page .user-image-card {
  background: #fff !important;
  border: 1px solid rgba(148, 163, 184, 0.22) !important;
  border-radius: 14px !important;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08) !important;
  padding: 10px !important;
  gap: 10px !important;
  align-items: stretch !important;
  min-height: 250px;
}

.my-files-page .user-image-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 30px rgba(251, 140, 0, 0.14) !important;
  border-color: rgba(251, 140, 0, 0.28) !important;
}

.my-files-page .user-image-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  height: auto !important;
  object-fit: cover;
  border-radius: 10px !important;
  border: 1px solid rgba(148, 163, 184, 0.16);
  margin-bottom: 0 !important;
  cursor: zoom-in;
}

.my-files-page .user-image-card .image-info {
  display: grid;
  gap: 3px;
}

.my-files-page .user-image-card .image-info span {
  color: #111827;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.34;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.my-files-page .user-image-card .image-info small {
  color: #64748b;
  font-size: 0.8rem;
  line-height: 1.35;
}

.my-files-page .user-image-card .card-actions {
  width: 100%;
  margin-top: auto;
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.my-files-page .user-image-card .card-actions button {
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 9px;
  min-height: 36px;
  padding: 7px 8px;
  font-size: 0.84rem;
  font-weight: 700;
}

.my-files-page .user-image-card .card-actions .download-btn {
  background: linear-gradient(135deg, #fb8c00, #f97316);
  border-color: transparent;
  color: #fff !important;
}

.my-files-page .user-image-card .card-actions .download-btn:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #f97316, #ea580c);
}

.my-files-page .user-image-card .card-actions .delete-btn {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.28);
  color: #b91c1c;
}

.my-files-page .user-image-card .card-actions .delete-btn:hover {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}

.my-files-page .my-files-empty-state {
  width: 100%;
  border-radius: 16px;
  border: 1px dashed rgba(251, 140, 0, 0.3);
  background: linear-gradient(165deg, rgba(255, 248, 237, 0.9), rgba(255, 255, 255, 0.9));
  padding: 34px 24px;
}

.my-files-page .user-images-list > .no-images {
  width: 100%;
  grid-column: 1 / -1;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  border-radius: 16px;
  border: 1px dashed rgba(251, 140, 0, 0.28);
  background: linear-gradient(165deg, rgba(255, 248, 237, 0.9), rgba(255, 255, 255, 0.9));
  padding: 34px 24px;
}

.my-files-page .user-images-list > .no-images p {
  margin: 0;
  color: #1f2937;
  font-size: 1.08rem;
  font-weight: 700;
}

.my-files-page .user-images-list > .no-images .empty-icon {
  font-size: 2.9rem;
  color: #fb8c00;
  opacity: 0.72;
}

.my-files-page .user-images-list > .no-images small {
  max-width: 56ch;
  margin: 0;
  color: #64748b;
  line-height: 1.65;
  font-size: 0.96rem;
}

.my-files-page .my-files-empty-state .empty-icon {
  font-size: 2.9rem;
}

.my-files-page .my-files-empty-state p {
  font-size: 1.08rem;
  color: #1f2937;
}

.my-files-page .my-files-empty-state small {
  color: #64748b;
  max-width: 56ch;
}

.my-files-login-btn {
  margin-top: 8px !important;
  min-width: 160px;
}

.my-files-limit-note {
  margin-top: 2px;
  color: #64748b !important;
  text-align: center;
  line-height: 1.5;
  font-size: 0.86rem;
}

.my-files-skeleton-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.my-files-skeleton-card {
  height: 244px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background:
    linear-gradient(90deg, rgba(241, 245, 249, 0.9) 0%, rgba(255, 255, 255, 0.95) 40%, rgba(241, 245, 249, 0.9) 100%);
  background-size: 220% 100%;
  animation: myFilesSkeleton 1.1s linear infinite;
}

@keyframes myFilesSkeleton {
  from {
    background-position: 0 0;
  }
  to {
    background-position: -220% 0;
  }
}

html[data-theme="dark"] .my-files-hero,
html[data-theme="dark"] .my-files-page .my-files-panel {
  border-color: rgba(255, 183, 77, 0.22);
  background: linear-gradient(170deg, rgba(22, 22, 26, 0.94), rgba(12, 12, 15, 0.92));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

html[data-theme="dark"] .my-files-badge {
  color: #ffd299;
  border-color: rgba(255, 183, 77, 0.36);
  background: rgba(255, 183, 77, 0.12);
}

html[data-theme="dark"] .my-files-hero-copy h1,
html[data-theme="dark"] .my-files-panel-head h2 {
  color: #f8fafc !important;
}

html[data-theme="dark"] .my-files-hero-copy p,
html[data-theme="dark"] .my-files-hero-side li,
html[data-theme="dark"] .my-files-panel-head p,
html[data-theme="dark"] .my-files-page .storage-stats .stat-item span,
html[data-theme="dark"] .my-files-page .user-image-card .image-info small,
html[data-theme="dark"] .my-files-limit-note,
html[data-theme="dark"] .my-files-actions-cta {
  color: #a1a1aa !important;
}

html[data-theme="dark"] .my-files-secondary-btn {
  color: #ffd299;
  border-color: rgba(255, 183, 77, 0.4);
  background: rgba(255, 183, 77, 0.12);
}

html[data-theme="dark"] .my-files-secondary-btn:hover {
  background: rgba(255, 183, 77, 0.2);
}

html[data-theme="dark"] .my-files-hero-side {
  background: linear-gradient(170deg, rgba(255, 183, 77, 0.08), rgba(255, 152, 0, 0.05));
  border-color: rgba(255, 183, 77, 0.24);
}

html[data-theme="dark"] .my-files-page .storage-stats .stat-item {
  background: linear-gradient(160deg, rgba(255, 183, 77, 0.08), rgba(18, 18, 22, 0.6)) !important;
  border-color: rgba(255, 183, 77, 0.2) !important;
}

html[data-theme="dark"] .my-files-page .storage-stats {
  background: transparent !important;
  border: 0 !important;
}

html[data-theme="dark"] .my-files-page .storage-stats .stat-item strong {
  color: #ffd299 !important;
}

html[data-theme="dark"] .my-files-page .user-image-card {
  background: rgba(21, 21, 26, 0.86) !important;
  border-color: rgba(255, 183, 77, 0.16) !important;
}

html[data-theme="dark"] .my-files-page .user-image-card .image-info span {
  color: #f4f4f5;
}

html[data-theme="dark"] .my-files-page .user-image-card img {
  border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .my-files-page .my-files-empty-state {
  background: linear-gradient(170deg, rgba(255, 183, 77, 0.08), rgba(22, 22, 26, 0.92));
  border-color: rgba(255, 183, 77, 0.28);
}

html[data-theme="dark"] .my-files-page .user-images-list > .no-images {
  background: linear-gradient(170deg, rgba(255, 183, 77, 0.08), rgba(22, 22, 26, 0.92));
  border-color: rgba(255, 183, 77, 0.28);
}

html[data-theme="dark"] .my-files-page .user-images-list > .no-images p {
  color: #f4f4f5;
}

html[data-theme="dark"] .my-files-page .user-images-list > .no-images small {
  color: #b4b4bb;
}

html[data-theme="dark"] .my-files-page .user-images-list > .no-images .empty-icon {
  color: #ffd299;
}

html[data-theme="dark"] .my-files-page .my-files-empty-state p {
  color: #f4f4f5;
}

html[data-theme="dark"] .my-files-page .my-files-empty-state small {
  color: #b4b4bb;
}

html[data-theme="dark"] .my-files-skeleton-card {
  border-color: rgba(255, 183, 77, 0.1);
  background:
    linear-gradient(90deg, rgba(33, 33, 40, 0.94) 0%, rgba(44, 44, 52, 0.98) 40%, rgba(33, 33, 40, 0.94) 100%);
  background-size: 220% 100%;
}

/* Theme stabilization for logged area */
.my-files-body .my-files-page .my-files-panel,
.my-files-body .my-files-page .storage-stats .stat-item,
.my-files-body .my-files-page .user-images-list > .no-images {
  background-image: none !important;
}

.my-files-body .my-files-page .my-files-panel {
  background: #f8fafc !important;
  border-color: #d7dee8 !important;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.1) !important;
}

.my-files-body .my-files-page .my-files-panel .my-files-panel-head h2 {
  color: #0f172a !important;
}

.my-files-body .my-files-page .my-files-panel .my-files-panel-head p,
.my-files-body .my-files-page .my-files-limit-note {
  color: #64748b !important;
}

.my-files-body .my-files-page .storage-stats .stat-item {
  background: #ffffff !important;
  border-color: rgba(251, 140, 0, 0.28) !important;
}

.my-files-body .my-files-page .storage-stats .stat-item strong {
  color: #c2410c !important;
}

.my-files-body .my-files-page .storage-stats .stat-item span {
  color: #64748b !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.my-files-body .my-files-page .user-images-list > .no-images {
  background: #ffffff !important;
  border-color: rgba(251, 140, 0, 0.3) !important;
}

.my-files-body .my-files-page .user-images-list > .no-images p {
  color: #1f2937 !important;
}

.my-files-body .my-files-page .user-images-list > .no-images small {
  color: #64748b !important;
}

html[data-theme="dark"] .my-files-body .my-files-page .my-files-hero {
  background: #1a1a1d !important;
  border-color: rgba(255, 183, 77, 0.22) !important;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.03) !important;
}

html[data-theme="dark"] .my-files-body .my-files-page .my-files-panel {
  background: #111827 !important;
  border-color: #2b3648 !important;
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="dark"] .my-files-body .my-files-page .my-files-panel .my-files-panel-head h2 {
  color: #f8fafc !important;
}

html[data-theme="dark"] .my-files-body .my-files-page .my-files-panel .my-files-panel-head p,
html[data-theme="dark"] .my-files-body .my-files-page .my-files-limit-note {
  color: #9ca3af !important;
}

html[data-theme="dark"] .my-files-body .my-files-page .storage-stats .stat-item {
  background: #1f2937 !important;
  border-color: #334155 !important;
}

html[data-theme="dark"] .my-files-body .my-files-page .storage-stats .stat-item strong {
  color: #fdba74 !important;
}

html[data-theme="dark"] .my-files-body .my-files-page .storage-stats .stat-item span {
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .my-files-body .my-files-page .user-images-list > .no-images {
  background: #1a1a1d !important;
  border-color: #374151 !important;
}

html[data-theme="dark"] .my-files-body .my-files-page .user-images-list > .no-images p {
  color: #f8fafc !important;
}

html[data-theme="dark"] .my-files-body .my-files-page .user-images-list > .no-images small {
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .my-files-body .my-files-page .user-images-list > .no-images .empty-icon {
  color: #fdba74 !important;
}

@media (max-width: 1100px) {
  .my-files-page {
    max-width: 95vw;
    margin-top: 82px;
  }

  .my-files-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .my-files-page {
    max-width: 100%;
    margin-top: 74px;
    padding: 0 10px;
  }

  .my-files-hero,
  .my-files-page .my-files-panel {
    border-radius: 16px;
  }

  .my-files-hero {
    padding: 20px;
  }

  .my-files-page .my-files-panel {
    padding: 18px !important;
  }

  .my-files-hero-actions,
  .my-files-actions-buttons {
    width: 100%;
  }

  .my-files-primary-link,
  .my-files-secondary-btn {
    width: 100%;
  }

  .my-files-panel-head h2 {
    font-size: 1.35rem !important;
  }

  .my-files-page .storage-stats .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  }

  .my-files-page .storage-stats .stat-item {
    align-items: flex-start !important;
  }

  .my-files-page .user-images-list,
  .my-files-skeleton-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
  }

  .my-files-page .user-image-card {
    min-height: 210px;
    padding: 8px !important;
  }

  .my-files-page .user-image-card .card-actions {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .my-files-primary-link,
  .my-files-secondary-btn,
  .my-files-page .user-image-card,
  .my-files-page .user-image-card .card-actions button,
  .my-files-skeleton-card {
    transition: none !important;
    animation: none !important;
  }
}
