/**
 * Ice Cleaning Services - Modern Drag & Drop Image Uploader
 * Compact Unified Single-Box Layout
 */

:root {
  --ice-primary: #112d46;
  --ice-accent: #FF5000;
  --ice-accent-hover: #e04600;
  --ice-bg-frost: #f8fafc;
  --ice-bg-hover: #fff9f6;
  --ice-border: #bae6fd;
  --ice-border-dashed: #7dd3fc;
  --ice-text-main: #0f172a;
  --ice-text-muted: #64748b;
  --ice-danger: #ef4444;
  --ice-radius: 12px;
  --ice-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.ice-uploader-container {
  box-sizing: border-box;
  font-family: var(--ice-font-family);
  margin: 0;
  width: 100%;
  max-width: 100%;
}

.ice-uploader-container *,
.ice-uploader-container *::before,
.ice-uploader-container *::after {
  box-sizing: border-box;
}

/* ==========================================================================
   Unified Single Box (Dropzone + Counter + Thumbnails in ONE container)
   ========================================================================== */
.ice-unified-box {
  position: relative;
  border: 2px dashed var(--ice-border-dashed);
  border-radius: var(--ice-radius);
  background: linear-gradient(180deg, var(--ice-bg-frost) 0%, #ffffff 100%);
  padding: 14px 16px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(17, 45, 70, 0.04);
}

.ice-unified-box:hover,
.ice-unified-box.ice-dragover {
  border-color: var(--ice-accent);
  background: var(--ice-bg-hover);
  box-shadow: 0 4px 14px rgba(255, 80, 0, 0.12);
}

/* Subtle top glow line when active */
.ice-dropzone-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #FF5000, #112d46, #FF5000);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: var(--ice-radius) var(--ice-radius) 0 0;
}

.ice-unified-box:hover .ice-dropzone-glow,
.ice-unified-box.ice-dragover .ice-dropzone-glow {
  opacity: 1;
}

/* ==========================================================================
   Top Action Strip (Text + Button + Counter)
   ========================================================================== */
.ice-dropzone {
  cursor: pointer;
  position: relative;
}

.ice-dropzone-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.ice-dropzone-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ice-dropzone-prompt {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: #334155;
  font-weight: 500;
}

.ice-dropzone-title {
  font-weight: 600;
  color: var(--ice-text-main);
  letter-spacing: 0.1px;
}

.ice-dropzone-or {
  color: var(--ice-text-muted);
  font-size: 13px;
}

/* Sleek Button: Navy #112d46 with Orange #FF5000 border */
.ice-select-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #112d46;
  color: #ffffff !important;
  border: none;
  border-bottom: 2px solid #FF5000;
  border-radius: 7px;
  padding: 7px 15px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 7px rgba(17, 45, 70, 0.2);
  transition: all 0.2s ease;
  line-height: 1.3;
}

.ice-select-btn svg {
  color: #FF5000;
  transition: color 0.2s ease;
}

.ice-select-btn:hover {
  background: #FF5000;
  border-bottom-color: #d94300;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(255, 80, 0, 0.35);
  transform: translateY(-1px);
}

.ice-select-btn:hover svg {
  color: #ffffff;
}

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

/* Right side Info & Counter */
.ice-dropzone-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ice-counter-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fff4ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 12px;
}

.ice-count-current {
  color: #FF5000;
}

.ice-limit-info {
  font-size: 12px;
  color: var(--ice-text-muted);
  font-weight: 500;
}

/* ==========================================================================
   Compact Photo Thumbnails Grid (Directly inside the box!)
   ========================================================================== */
.ice-preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #e2e8f0;
}

.ice-preview-grid:empty {
  display: none !important;
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

/* Mini Photo Card (74px x 74px) */
.ice-card {
  position: relative;
  width: 74px;
  height: 74px;
  border-radius: 8px;
  overflow: hidden;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.06);
  animation: iceCardPop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

@keyframes iceCardPop {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.ice-card:hover {
  border-color: #FF5000;
  box-shadow: 0 4px 12px rgba(255, 80, 0, 0.2);
  transform: translateY(-2px);
}

.ice-card-thumb {
  position: relative;
  width: 100%;
  height: 100%;
}

.ice-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.ice-card:hover .ice-card-img {
  transform: scale(1.06);
}

/* Delete (X) Icon on top right */
.ice-card-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease;
  z-index: 5;
}

.ice-card-remove svg {
  width: 11px;
  height: 11px;
}

.ice-card-remove:hover {
  background: var(--ice-danger);
  transform: scale(1.15);
}

/* Bottom Progress Bar on the thumbnail while uploading */
.ice-card-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3.5px;
  background: rgba(255, 255, 255, 0.5);
  overflow: hidden;
}

.ice-card-progress-bar {
  height: 100%;
  width: 0%;
  background: #FF5000;
  transition: width 0.2s ease;
}

.ice-card.is-complete .ice-card-progress {
  display: none !important;
}

/* Error state on card */
.ice-card.is-error {
  border-color: var(--ice-danger);
}

/* ==========================================================================
   Hidden Legacy Elements (Guaranteed Clean Display)
   ========================================================================== */
.ice-dropzone-icon-wrap,
.ice-dropzone-icon,
.ice-ice-sparkle,
.ice-badge-webp,
.ice-card-badge,
.ice-card-details,
.ice-card-name,
.ice-card-meta,
.ice-card-size,
.ice-card-status,
.ice-uploader-header-status {
  display: none !important;
}

/* ==========================================================================
   Error Messages / Alerts
   ========================================================================== */
.ice-uploader-messages {
  margin-top: 8px;
}

.ice-error-alert {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  border-radius: 7px;
  padding: 7px 12px;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.ice-error-close {
  background: none;
  border: none;
  color: #991b1b;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

/* Validation error on CF7 wrapper */
.wpcf7-not-valid .ice-unified-box {
  border-color: var(--ice-danger) !important;
  background: #fffafa !important;
}

/* ==========================================================================
   Mobile Responsive (< 680px)
   ========================================================================== */
@media (max-width: 680px) {
  .ice-unified-box {
    padding: 10px 12px;
  }

  .ice-dropzone-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .ice-dropzone-left {
    width: 100%;
    justify-content: space-between;
  }

  /* Hide drag & drop prompt on touchscreens */
  .ice-dropzone-title,
  .ice-dropzone-or {
    display: none !important;
  }

  .ice-select-btn {
    width: auto;
    padding: 7px 14px;
    font-size: 13px;
  }

  .ice-dropzone-right {
    width: 100%;
    justify-content: space-between;
    font-size: 11.5px;
  }

  .ice-counter-badge {
    font-size: 11px;
    padding: 2px 8px;
  }

  .ice-limit-info {
    font-size: 11px;
  }

  /* Compact 66px thumbnails on mobile */
  .ice-card {
    width: 66px;
    height: 66px;
  }
}
