/* ========================================
   Modern File Upload Components - CSS
   Extension for ModernUI Template
   ======================================== */

/* ========================================
   Base Upload Zone Styles
   ======================================== */
.drop-zone-container {
	border: 2px dashed rgba(6, 84, 196, 0.3);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.95);
	backdrop-filter: blur(10px);
	padding:6px;
}

.drop-zone-container.medium {
	width:300px;
}

.drop-zone-container.small {
	width: 290px;
    height: 50px;
}
	
.drop-zone {
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    box-sizing: border-box;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
	background-size:cover;
}

.drop-zone:hover {
    border-color: #0654c4;
    
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(6, 84, 196, 0.15);
}

.drop-zone.dragover {
    border-color: #0654c4;
    background: linear-gradient(135deg, rgba(6, 84, 196, 0.1), rgba(30, 115, 190, 0.1));
    transform: scale(1.02);
    box-shadow: 0 15px 35px rgba(6, 84, 196, 0.2);
}

.drop-zone.uploading {
    pointer-events: none;
    opacity: 0.7;
}

/* ========================================
   Size Variants
   ======================================== */
.drop-zone.large {
    width: 100%;
    min-height: 200px;
    padding: 40px 20px;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drop-zone.medium {
	width:100%;
    padding: 25px 15px;
    font-size: 15px;
}

.drop-zone.small {
    width: 100%;
    height: 100%;
    padding: 10px 15px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drop-zone.portrait {
    width: 120px;
    height: 160px;
    padding: 10px;
    font-size: 11px;
}

/* ========================================
   Upload Content Wrapper
   ======================================== */
.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
}

/* Horizontal layout for small drop zones */
.drop-zone.small .upload-content {
    flex-direction: row;
    gap: 10px;
    justify-content: center;
}

.upload-icon {
    font-size: 32px;
    color: #0654c4;
    margin-bottom: 10px;
}

.upload-text {
    color: #666;
    margin: 0;
}

.upload-text.primary {
    font-weight: 600;
    color: #333;
}

.upload-text.secondary {
    font-size: 12px;
    opacity: 0.8;
}

/* ========================================
   Upload Button
   ======================================== */
.upload-button {
    padding: 10px 20px;
    background: linear-gradient(135deg, #0654c4, #1e73be);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    margin-top: 10px;
    outline: none;
}

.upload-button:hover {
    background: linear-gradient(135deg, #054393, #1a5da6);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(6, 84, 196, 0.3);
}

.upload-button:active {
    transform: translateY(0);
}

.upload-button.secondary {
    background: rgba(6, 84, 196, 0.1);
    color: #0654c4;
    padding: 8px 16px;
    font-size: 12px;
	margin-top:0px;
}

.upload-button.secondary:hover {
    background: rgba(6, 84, 196, 0.2);
}

/* ========================================
   Hidden File Input
   ======================================== */
.upload-input {
    display: none;
}

/* ========================================
   Progress Bar Components
   ======================================== */
.upload-progress {
    width: 100%;
    height: 8px;
    background: rgba(6, 84, 196, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 15px;
    position: relative;
}

.upload-progress.small {
    height: 6px;
}

.upload-progress.large {
    height: 12px;
}

.upload-progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #0654c4, #1e73be);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.upload-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.upload-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    font-weight: 600;
    color: #0654c4;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    pointer-events: none;
}

/* ========================================
   Upload Preview
   ======================================== */
.upload-preview {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.upload-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.drop-zone:hover .upload-preview::before {
    opacity: 1;
}

.upload-preview-actions {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    gap: 10px;
}

.drop-zone:hover .upload-preview-actions {
    opacity: 1;
}

.preview-action {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.preview-action:hover {
    background: white;
    transform: scale(1.05);
}

.preview-action.danger {
    background: rgba(220, 53, 69, 0.9);
    color: white;
}

.preview-action.danger:hover {
    background: #dc3545;
}

/* ========================================
   Multiple Upload Zone
   ======================================== */


.drop_multiple_file_zone {
  position: relative;
  min-height: 150px;
  width: 100%;
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  transition: background .2s, border-color .2s, box-shadow .2s;
  display: block;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

/* Hover / drag-over highlight */
.drop_multiple_file_zone:hover,
.drop_multiple_file_zone.drag-over {
  background: #f1f5f9;
  border-color: #94a3b8;
  box-shadow: 0 0 0 4px rgba(148,163,184,.15) inset;
  cursor: pointer;
}

/* Inner content */
.drag_upload_multiple_file {
  text-align: center;
  max-width: 520px;
  pointer-events: none; /* allow clicks to pass through except on the button */
}

.drag_upload_multiple_file p {
  margin: 6px 0;
  color: #666;
}

/* Hide native file input; use the button */
.drag_upload_multiple_file input[type="file"] {
  display: none;
}

/* Re-enable pointer events for the trigger button inside */
.drag_zone_multiple_upload_select_button {
  pointer-events: auto;
}

/* Container spacing */
.file-attachment-container {
  display: grid;
  gap: 12px;
}

/* Uploaded assets grid */
#imageAssetsContainer,
#documentSectionsContainer {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

/* Asset / document tiles */
.image-asset-item,
.document-section-item {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* Thumbnails */
.asset-thumbnail {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

/* Tile controls */
.asset-controls,
.section-controls {
  display: flex;
  gap: 8px;
  width: 100%;
  justify-content: center;
}

/* Document rows (icon + filename) */
.document-section-item i {
  font-size: 32px;
  color: #64748b;
}

.document-section-item .filename {
  font-size: 12px;
  color: #334155;
  word-break: break-all;
  text-align: center;
}

/* File title input */
.file-title-input {
  width: 100%;
  padding: 6px 8px;
  font-size: 13px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  margin-top: 6px;
  transition: border-color 0.2s ease;
  background: #f8f9fa;
}

.file-title-input:focus {
  outline: none;
  border-color: #0654c4;
  background: #ffffff;
}

.file-title-input::placeholder {
  color: #999;
  font-style: italic;
}

/* Legacy class mapping (keeps old styles working if present) */
.drop-zone.multiple { min-height: 150px; width: 100%; }
.multiple-upload-content { text-align: center; }
.multiple-upload-text { margin: 5px 0; color: #666; }
.multiple-upload-text.highlight { font-weight: 600; color: #333; }

/* Small screens */
@media (max-width: 480px) {
  .asset-thumbnail { height: 96px; }
}



/* ========================================
   Upload Status Messages
   ======================================== */
.upload-status {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
}

.upload-status.success {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.upload-status.error {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.2);
}

.upload-status.warning {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.2);
}

/* ========================================
   Progress
   ======================================== */
.progress {
  position:relative; 
  width:100%; 
  border: 1px solid #ddd; 
  padding: 1px; 
  border-radius: 2px; 
}

.bar { 
  background-color: #93c572; 
  width:0%; 
  height:10px; 
  border-radius: 2px; 
}

.percent { 
  position:absolute; 
  display:inline-block; 
  top:0px; 
  left:48%; 
  font-size:10px;
}
/*     */
.portrait_progress {
  position:relative; 
  width:80px; 
  border: 1px solid #ddd; 
  padding: 1px; 
  border-radius: 1px; 
}
.small_progress {
  position:relative; 
  width:290px; 
  border: 1px solid #ddd; 
  padding: 1px; 
  border-radius: 1px; 
}

.small_bar { 
  background-color: #93c572; 
  width:0%; 
  height:11px; 
  border-radius: 3px; 
}

.small_percent { 
  position:absolute; 
  display:inline-block; 
  top:3px; 
  left:48%; 
  font-size:8px;
  line-height:10px;
}
/* ========================================
   File Type Icons
   ======================================== */
.file-type-icon {
    font-size: 24px;
    margin-bottom: 8px;
    display: block;
}

.file-type-icon.image::before { content: '🖼️'; }
.file-type-icon.pdf::before { content: '📄'; }
.file-type-icon.document::before { content: '📝'; }
.file-type-icon.audio::before { content: '🎵'; }
.file-type-icon.video::before { content: '🎬'; }
.file-type-icon.archive::before { content: '📦'; }
.file-type-icon.generic::before { content: '📁'; }

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    .drop-zone.medium,
    .drop-zone.small {
        width: 100%;
        max-width: 300px;
    }
    
    .drop-zone.large {
        min-height: 120px;
        padding: 20px 15px;
        font-size: 14px;
    }
    
    .upload-icon {
        font-size: 24px;
    }
    
    .upload-button {
        padding: 8px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .drop-zone {
        font-size: 12px;
    }
    
    .drop-zone.large {
        min-height: 100px;
        padding: 15px 10px;
    }
    
    .upload-icon {
        font-size: 20px;
        margin-bottom: 5px;
    }
    
    .upload-button {
        padding: 6px 12px;
        font-size: 12px;
        margin-top: 5px;
    }
    
    .upload-content {
        gap: 5px;
    }
}

/* ========================================
   Animation Classes
   ======================================== */
.upload-fade-in {
    animation: uploadFadeIn 0.5s ease-out;
}

.upload-slide-up {
    animation: uploadSlideUp 0.4s ease-out;
}

@keyframes uploadFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes uploadSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Integration with Controls Framework
   ======================================== */
.form-container .drop-zone {
    margin-bottom: 20px;
}

.form-group .drop-zone {
    margin-top: 8px;
}

.demo-section .drop-zone {
    margin: 15px 0;
}