/* ==========================================
   PHONA RECENTS PAGE
   Página de processamentos recentes
   Segue identidade visual do site
   ========================================== */

/* ==========================================
   RECENTS HERO
   ========================================== */
.recents-hero {
  padding: clamp(2rem, 6vw, 4rem) clamp(1rem, 4vw, 2rem) clamp(1.5rem, 4vw, 3rem);
  background: var(--bg-primary);
  text-align: center;
}

.recents-hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.recents-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  background: rgba(194, 140, 102, 0.1);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: clamp(0.8rem, 2vw, 0.875rem);
  font-weight: 500;
  color: var(--copper-light);
  margin-bottom: clamp(1rem, 3vw, 2rem);
  backdrop-filter: blur(10px);
}

.badge-dot {
  width: 8px;
  height: 8px;
  background: var(--copper);
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
  transform: translateZ(0);
}

@keyframes pulse-dot {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }
}

.recents-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: clamp(0.75rem, 2vw, 1rem);
  color: var(--text-primary);
  padding: 0 1rem;
}

.recents-subtitle {
  font-size: clamp(0.95rem, 2.5vw, 1.125rem);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
  padding: 0 1rem;
}

/* ==========================================
   RECENTS SECTION
   ========================================== */
.recents-section {
  padding: var(--space-2xl) 2rem var(--space-3xl);
  background: var(--bg-secondary);
  min-height: 60vh;
}

/* ==========================================
   USER INFO CARD
   ========================================== */
.user-info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.user-info-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--copper), var(--copper-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.user-details {
  flex: 1;
}

.user-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.user-email {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ==========================================
   LOADING STATE
   ========================================== */
.recents-loading {
  text-align: center;
  padding: var(--space-3xl) 2rem;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  margin: 0 auto 1.5rem;
  border: 3px solid var(--border);
  border-top-color: var(--copper);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-text {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* ==========================================
   EMPTY STATE
   ========================================== */
.recents-empty {
  text-align: center;
  padding: var(--space-3xl) 2rem;
  max-width: 500px;
  margin: 0 auto;
}

.empty-icon {
  font-size: 5rem;
  margin-bottom: 1.5rem;
  opacity: 0.6;
}

.empty-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.empty-description {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.empty-action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==========================================
   PROCESSING GRID
   ========================================== */
.recents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: clamp(1.25rem, 3vw, 2rem);
  margin-top: clamp(1.5rem, 3vw, 2rem);
  animation: fadeInUp 0.6s ease-out 0.2s both;
}

.processing-card {
  animation: fadeInUp 0.4s ease-out both;
}

.processing-card:nth-child(1) {
  animation-delay: 0.1s;
}

.processing-card:nth-child(2) {
  animation-delay: 0.2s;
}

.processing-card:nth-child(3) {
  animation-delay: 0.3s;
}

.processing-card:nth-child(4) {
  animation-delay: 0.4s;
}

.processing-card:nth-child(5) {
  animation-delay: 0.5s;
}

.processing-card:nth-child(n+6) {
  animation-delay: 0.6s;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================
   PROCESSING CARD
   ========================================== */
.processing-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: clamp(12px, 2vw, 16px);
  padding: clamp(1.25rem, 4vw, 2rem);
  transition: transform var(--animation-duration) var(--ease-smooth),
    border-color var(--animation-duration) var(--ease-smooth),
    box-shadow var(--animation-duration) var(--ease-smooth);
  overflow: hidden;
  transform: translateZ(0);
}

.processing-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(90deg,
      transparent,
      transparent 2px,
      rgba(194, 140, 102, 0.02) 2px,
      rgba(194, 140, 102, 0.02) 4px);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--animation-duration) var(--ease-smooth);
}

@media (hover: hover) {
  .processing-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3),
      0 0 0 1px rgba(194, 140, 102, 0.2) inset;
  }

  .processing-card:hover::before {
    opacity: 1;
  }
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word;
  flex: 1;
  line-height: 1.4;
}

.card-preset {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.875rem;
  background: linear-gradient(135deg, var(--copper), var(--copper-dark));
  color: white;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  margin-bottom: 0;
  box-shadow: 0 2px 8px rgba(194, 140, 102, 0.3);
}

.card-info {
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
}

.info-label {
  color: var(--text-muted);
  font-weight: 500;
}

.info-value {
  color: var(--text-primary);
  font-weight: 600;
  text-align: right;
}

/* ==========================================
   EXPIRATION BAR
   ========================================== */
.expiration-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-secondary);
  border-radius: 3px;
  overflow: hidden;
  margin: 1.5rem 0;
  position: relative;
}

.expiration-progress {
  height: 100%;
  background: linear-gradient(90deg,
      var(--copper) 0%,
      var(--copper-light) 50%,
      var(--copper-dark) 100%);
  border-radius: 3px;
  transition: width 1s linear;
  position: relative;
}

.expiration-progress::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--copper);
  box-shadow: 0 0 8px rgba(194, 140, 102, 0.6);
}

.expiration-time {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 1.5rem;
  padding: 0.5rem;
  background: rgba(194, 140, 102, 0.05);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.expiration-time strong {
  color: var(--copper-light);
  font-weight: 700;
}

.expiration-time.warning {
  background: rgba(255, 193, 58, 0.1);
  border-color: rgba(255, 193, 58, 0.3);
  color: #ffc13a;
}

.expiration-time.warning strong {
  color: #ffc13a;
}

.expiration-time.danger {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
  animation: pulse-warning 2s ease-in-out infinite;
}

.expiration-time.danger strong {
  color: #ef4444;
}

@keyframes pulse-warning {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

/* ==========================================
   CARD ACTIONS
   ========================================== */
.card-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn-download {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  background: linear-gradient(135deg, var(--copper), var(--copper-dark));
  color: white;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--animation-duration) var(--ease-smooth);
  border: none;
  cursor: pointer;
  transform: translateZ(0);
}

.btn-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(194, 140, 102, 0.4);
}

.btn-download:active {
  transform: translateY(0);
}

.btn-delete {
  padding: 0.875rem 1rem;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--animation-duration) var(--ease-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  min-width: 48px;
}

.btn-delete:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  transform: scale(1.05);
}

.btn-delete:active {
  transform: scale(0.95);
}

/* ==========================================
   CONTAINER
   ========================================== */
.recents-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

/* Large tablets and small desktops */
@media (max-width: 1200px) {
  .recents-container {
    max-width: 1100px;
  }
}

/* Tablets landscape */
@media (max-width: 1024px) {
  .recents-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  }

  .recents-container {
    padding: 0 1.25rem;
  }
}

/* Tablets portrait */
@media (max-width: 768px) {
  .recents-section {
    padding: clamp(1.5rem, 4vw, 2rem) 1rem clamp(2rem, 5vw, 3rem);
  }

  .recents-container {
    padding: 0 1rem;
  }

  .recents-grid {
    grid-template-columns: 1fr;
  }

  .user-info-card {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .card-preset {
    margin-bottom: 0;
  }

  .card-actions {
    flex-direction: column;
    gap: 0.625rem;
  }

  .btn-download,
  .btn-delete {
    width: 100%;
  }
}

/* Mobile landscape */
@media (max-width: 640px) {
  .recents-badge {
    padding: 0.4rem 1rem;
  }

  .user-info-card {
    padding: 1.25rem;
  }

  .user-avatar {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
  }

  .card-info {
    gap: 0.625rem;
  }

  .btn-download {
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
  }

  .btn-delete {
    padding: 0.75rem;
    min-width: 44px;
  }
}

/* Mobile portrait */
@media (max-width: 480px) {
  .empty-icon {
    font-size: 3.5rem;
  }

  .empty-title {
    font-size: 1.25rem;
  }

  .empty-description {
    font-size: 0.9rem;
  }

  .card-title {
    font-size: 1rem;
  }

  .info-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .info-label,
  .info-value {
    font-size: 0.8125rem;
  }

  .info-value {
    text-align: left;
  }

  .expiration-time {
    font-size: 0.8125rem;
    padding: 0.4rem;
  }

  .card-preset {
    font-size: 0.7rem;
    padding: 0.3rem 0.75rem;
  }
}

/* Small mobile devices */
@media (max-width: 360px) {
  .recents-container {
    padding: 0 0.75rem;
  }

  .recents-badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.875rem;
  }

  .user-info-card {
    padding: 1rem;
  }

  .user-email {
    font-size: 0.85rem;
    word-break: break-all;
  }

  .btn-download {
    padding: 0.625rem 1rem;
    font-size: 0.85rem;
  }
}

/* ==========================================
   DELETE ALL BUTTON
   ========================================== */
.btn-delete-all {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.875rem 1.75rem;
  margin-top: 1.5rem;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 2px solid rgba(239, 68, 68, 0.3);
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--animation-duration) var(--ease-smooth);
  transform: translateZ(0);
}

.btn-delete-all:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.3);
}

.btn-delete-all:active {
  transform: translateY(0);
}

.btn-delete-all svg {
  flex-shrink: 0;
}

/* ==========================================
   DELETE ALL MODAL
   ========================================== */
.delete-all-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 50%;
  color: #ef4444;
}

.delete-all-warning {
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 12px;
  padding: 1.25rem;
  margin: 1.5rem 0;
}

.delete-all-warning p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.6;
}

.delete-all-warning p:first-child {
  margin-bottom: 0.75rem;
}

.delete-all-warning strong {
  color: #ef4444;
}

.btn-danger {
  background: #ef4444 !important;
  color: white !important;
  border: none !important;
}

.btn-danger:hover {
  background: #dc2626 !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.4);
}

.btn-danger:active {
  transform: translateY(0);
}

.btn-danger:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.btn-secondary {
  background: rgba(107, 114, 128, 0.1) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border) !important;
}

.btn-secondary:hover {
  background: rgba(107, 114, 128, 0.15) !important;
  border-color: rgba(107, 114, 128, 0.3) !important;
}

/* ==========================================
   RESPONSIVE - DELETE ALL
   ========================================== */
@media (max-width: 768px) {
  .btn-delete-all {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
  }

  .delete-all-warning {
    padding: 1rem;
    font-size: 0.9rem;
  }

  .modal-actions {
    flex-direction: column !important;
  }

  .modal-actions button {
    width: 100% !important;
  }
}

@media (max-width: 480px) {
  .btn-delete-all {
    width: 100%;
    justify-content: center;
  }

  .delete-all-icon {
    width: 56px;
    height: 56px;
  }

  .delete-all-icon svg {
    width: 40px;
    height: 40px;
  }
}