/**
 * Upload Status Styles for RadiaMaps PWA
 * Provides visual styling for the upload feedback overlay
 */

.upload-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.upload-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.upload-modal {
    background-color: #222;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 255, 136, 0.2);
    border: 1px solid rgba(0, 255, 136, 0.3);
    position: relative;
}

.upload-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.upload-log {
    color: grey;
}

.upload-icon {
    width: 40px;
    height: 40px;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-title {
    margin: 0;
    color: #00ff88;
    font-size: 1.5rem;
}

.upload-content {
    margin-bottom: 15px;
}

.file-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    color: #ccc;
}

.file-name {
    max-width: 70%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.progress-container {
    margin-bottom: 15px;
}

.progress-bar {
    height: 8px;
    background-color: #444;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-fill {
    height: 100%;
    background-color: #00ff88;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.9rem;
    color: #ccc;
    float: right;
}

.file-upload-summary {
    color: grey;
}

.status-message {
    color: #ddd;
    font-size: 1rem;
    text-align: center;
    margin-top: 10px;
}

.upload-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    width: 30px;
    height: 30px;
    padding: 0;
}

.upload-close svg {
    width: 100%;
    height: 100%;
    fill: #ccc;
}

.upload-close:hover svg {
    fill: #00ff88;
}

/* Spinner Animation */
.spinner {
    animation: rotate 2s linear infinite;
    width: 100%;
    height: 100%;
}

.path {
    stroke: #00ff88;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

/* Success and Error Icons */
.success-icon, .error-icon {
    width: 100%;
    height: 100%;
}

.success-icon {
    fill: #00ff88;
}

.error-icon {
    fill: #ff4444;
}

/* Lock scrolling when upload is in progress */
body.upload-in-progress {
    overflow: hidden;
}
/* Drag & Drop Overlay */
.drop-overlay.hidden { display:none; }
.drop-overlay { position:fixed; inset:0; z-index:12000; background:rgba(0,0,0,0.55); backdrop-filter:blur(2px); display:flex; align-items:center; justify-content:center; opacity:0; pointer-events:none; transition:opacity .18s ease; }
.drop-overlay.active { opacity:1; pointer-events:auto; }
.drop-overlay-inner { text-align:center; font-family:monospace; padding:30px 40px; border:2px dashed #00ff88; border-radius:18px; background:rgba(15,15,17,0.72); box-shadow:0 0 25px -4px rgba(0,255,136,0.5), 0 0 2px 1px rgba(0,255,136,0.4) inset; animation:dropPulse 2.5s linear infinite; max-width:480px; }
.drop-overlay.drag-ready .drop-overlay-inner { border-style:dotted; opacity:.85; }
.drop-overlay-icon { font-size:3rem; margin-bottom:10px; filter:drop-shadow(0 0 6px #00ff88); }
.drop-overlay-text { font-size:1.35rem; letter-spacing:1px; color:#00ff88; margin-bottom:6px; }
.drop-overlay-sub { font-size:0.75rem; text-transform:uppercase; letter-spacing:1px; opacity:.75; color:#ddd; }
@keyframes dropPulse { 0% { box-shadow:0 0 25px -4px rgba(0,255,136,0.45), 0 0 2px 1px rgba(0,255,136,0.4) inset;} 50% { box-shadow:0 0 32px 2px rgba(0,255,136,0.65), 0 0 4px 1px rgba(0,255,136,0.55) inset;} 100% { box-shadow:0 0 25px -4px rgba(0,255,136,0.45), 0 0 2px 1px rgba(0,255,136,0.4) inset;} }
@media (max-width:600px){ .drop-overlay-inner { padding:22px 26px; } .drop-overlay-text { font-size:1.05rem; } .drop-overlay-icon{ font-size:2.4rem; } }
/* Styles for minimized upload modal */
#upload-progress-modal.minimized {
    top: auto;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 500px;
    height: auto;
    background-color: transparent;
    box-shadow: none;
    border: none;
    cursor: pointer;
    z-index: 10001; /* Ensure it stays on top */
    transition: top 0.3s ease, bottom 0.3s ease, width 0.3s ease, height 0.3s ease;
}

#upload-progress-modal.minimized .upload-modal {
    padding: 10px;
    background-color: #2a2a2e; /* Slightly different background for the bar */
    border: 1px solid #00ff88;
    box-shadow: 0 -2px 10px rgba(0, 255, 136, 0.3);
}

#upload-progress-modal.minimized .upload-header,
#upload-progress-modal.minimized .upload-content,
#upload-progress-modal.minimized .upload-close,
#upload-progress-modal.minimized #upload-log-container,
#upload-progress-modal.minimized #overall-upload-summary,
#upload-progress-modal.minimized #file-upload-summaries-list {
    display: none;
}

#upload-progress-modal.minimized #upload-progress-title {
    display: block;
    font-size: 0.9rem;
    color: #ccc;
    text-align: center;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#upload-progress-modal.minimized .progress-container {
    margin-bottom: 0;
}

@media (max-width: 945px) {
    #upload-progress-modal.minimized .modal-body {
        display: none;
    }
}