/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Upload Section Styles */
.upload-section {
    margin-bottom: 30px;
}

.upload-area {
    background: white;
    border: 3px dashed #ddd;
    border-radius: 15px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.upload-area.drag-over {
    border-color: #667eea;
    background: #f0f4ff;
    transform: scale(1.02);
}

.upload-content {
    position: relative;
    z-index: 2;
}

.upload-icon {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 15px;
    display: block;
}

.upload-area h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #333;
}

.upload-area p {
    color: #666;
    margin-bottom: 5px;
}

.file-types {
    font-size: 0.9rem;
    color: #999 !important;
    margin-bottom: 20px !important;
}

#fileInput {
    display: none;
}

.select-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.select-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Error Section Styles */
.error-section {
    margin-bottom: 20px;
}

.error-message {
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 10px;
    padding: 15px;
    color: #c33;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.error-message i {
    font-size: 1.2rem;
}

/* Controls Section Styles */
.controls-section {
    margin-bottom: 30px;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.control-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-btn:hover {
    background: #ff5252;
    transform: translateY(-1px);
}

.image-count {
    color: #666;
    font-weight: 500;
}

/* Gallery Section Styles */
.gallery-header {
    text-align: center;
    margin-bottom: 20px;
    color: white;
}

.gallery-header h2 {
    font-size: 2rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.image-item {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
}

.image-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

.image-container {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.image-item:hover .image-container img {
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
}

.image-item:hover .image-overlay {
    opacity: 1;
}

.image-overlay:hover {
    background: #ff4444;
}

.image-info {
    padding: 15px;
}

.image-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    word-break: break-word;
}

.image-size {
    color: #666;
    font-size: 0.9rem;
}

.image-dimensions {
    color: #999;
    font-size: 0.8rem;
    margin-top: 5px;
}

/* Empty State Styles */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: white;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.7;
}

.empty-state h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.empty-state p {
    font-size: 1.1rem;
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .upload-area {
        padding: 30px 15px;
    }
    
    .upload-icon {
        font-size: 2.5rem;
    }
    
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }
    
    .controls {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .empty-state {
        padding: 40px 20px;
    }
    
    .empty-icon {
        font-size: 3rem;
    }
}

@media (max-width: 480px) {
    .gallery {
        grid-template-columns: 1fr;
    }
    
    .upload-area {
        padding: 25px 10px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .gallery-header h2 {
        font-size: 1.5rem;
    }
}

/* Overall score badge */
.score-badge {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  width: 130px;
  height: 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  font-weight: 150;
  color: #333;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  z-index: 10;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.3s ease;
}

.score-badge.visible {
  opacity: 1;
  transform: scale(1);
}

.score-badge .score-number {
  font-size: 32px;
  font-weight: 300;
  margin-bottom: -2px;
}

.score-badge .score-label {
  font-size: 13px;
  font-weight: 150;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.7;
}

/* Metrics grid */
.metrics-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 320px;
  justify-content: center;
  margin: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.metrics-grid.visible {
  opacity: 1;
  margin: 1rem 0 2rem 0;
  max-height: 250px;
}

.metric-badge {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.metric-badge:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

.metric-badge .metric-value {
  font-size: 11px;
  font-weight: 500;
  margin-bottom: 1px;
  line-height: 1;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  z-index: 2;
}

.metric-badge .metric-label {
  font-size: 5.5px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  text-align: center;
  line-height: 1;
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  z-index: 2;
}

/* Color coding based on score ranges - dark premium luxury shades */
.metric-badge.score-very-strong { background: linear-gradient(135deg, #1a4d66, #0d2633); } /* Dark cyan for 90+ */
.metric-badge.score-strong { background: linear-gradient(135deg, #003d1a, #002611); } /* Dark green for 70-89 */
.metric-badge.score-average { background: linear-gradient(135deg, #4d2f00, #331f00); } /* Dark orange for 50-69 */
.metric-badge.score-weak { background: linear-gradient(135deg, #4d1a1a, #330d0d); } /* Dark red for 30-49 */
.metric-badge.score-very-weak { background: linear-gradient(135deg, #331010, #1a0808); } /* Very dark red for below 30 */
.metric-badge.score-default { background: linear-gradient(135deg, #2a2a2a, #1a1a1a); }

/* Body info pills - extremely small and premium */
.body-info-pills {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin: 0;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.body-info-pills.visible {
  opacity: 1;
  max-height: 40px;
  margin: 0.8rem 0;
}

.body-pill {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.6), rgba(20, 20, 20, 0.8));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 0.33rem 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.44rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
  min-width: 77px;
  justify-content: space-between;
}

.body-pill:hover {
  background: linear-gradient(135deg, rgba(10, 10, 10, 0.8), rgba(30, 30, 30, 0.9));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.pill-label {
  font-size: 0.55rem;
  font-weight: 600;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.9;
}

.pill-value {
  font-size: 0.66rem;
  font-weight: 500;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Premium tooltip styling for metric badges */
.metric-badge.has-tooltip {
  position: relative;
  cursor: pointer;
}

.metric-badge.has-tooltip::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.95);
  color: #fff;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  font-size: 0.65rem;
  font-weight: 400;
  line-height: 1.3;
  max-width: 200px;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 9999;
  word-wrap: break-word;
  white-space: normal;
}

.metric-badge.has-tooltip::after {
  content: '';
  position: absolute;
  bottom: 115%;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid rgba(0, 0, 0, 0.95);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
}

.metric-badge.has-tooltip:hover::before,
.metric-badge.has-tooltip:hover::after {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateX(-50%) translateY(-5px) !important;
}

/* Instruction text styling - positioned at top right of metrics grid */
.metrics-instruction {
  position: absolute;
  top: -2.5rem;
  right: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 10;
}

.metrics-instruction.visible {
  opacity: 1;
}

.instruction-text {
  font-size: 0.55rem;
  font-weight: 400;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.3rem 0.8rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(5px);
}

/* Premium tooltip modal styling */
.tooltip-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tooltip-overlay.visible {
  opacity: 1;
}

.tooltip-modal {
  background: linear-gradient(135deg, rgba(20, 20, 20, 0.95), rgba(40, 40, 40, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 1.5rem;
  max-width: 320px;
  width: 90%;
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.tooltip-overlay.visible .tooltip-modal {
  transform: scale(1);
}

.tooltip-header {
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
  text-align: center;
  opacity: 0.9;
}

.tooltip-content {
  font-size: 0.75rem;
  font-weight: 400;
  color: #e0e0e0;
  line-height: 1.4;
  text-align: center;
  margin-bottom: 1rem;
}

.tooltip-close {
  position: absolute;
  top: 0.8rem;
  right: 1rem;
  font-size: 1.2rem;
  color: #999;
  cursor: pointer;
  transition: color 0.3s ease;
}

.tooltip-close:hover {
  color: #fff;
}

/* Animation for new images */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.image-item.new-image {
    animation: fadeInUp 0.5s ease;
}

/* Real-time notification system */
.notification-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  pointer-events: none;
}

.notification {
  background: linear-gradient(135deg, rgba(139, 69, 19, 0.95), rgba(160, 82, 45, 0.95));
  color: #ffffff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.3px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease-out;
  opacity: 0.95;
  white-space: nowrap;
  text-align: center;
  min-width: 120px;
}

.notification.success {
  background: linear-gradient(135deg, rgba(34, 139, 34, 0.95), rgba(50, 205, 50, 0.95));
}

.notification.error {
  background: linear-gradient(135deg, rgba(139, 34, 34, 0.95), rgba(205, 50, 50, 0.95));
}

.notification.loading {
  background: linear-gradient(135deg, rgba(70, 130, 180, 0.95), rgba(100, 149, 237, 0.95));
}

.notification.processing {
  background: linear-gradient(135deg, rgba(255, 140, 0, 0.95), rgba(255, 165, 0, 0.95));
}

@keyframes slideUp {
  from {
    transform: translateX(-50%) translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 0.95;
  }
}

/* Pulse animation for loading states */
.notification.loading::after {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  margin-left: 6px;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}
