/* Modal overlay */
.upload-modal-overlay .mfp-close {
    display: none;
}
.upload-modal-overlay p,
.upload-modal-overlay button {
    margin-bottom: 0rem;
    padding-bottom: 0rem;
    /* height: auto; */
}
.upload-modal-overlay i{
    font-style: normal;
}
.upload-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.upload-modal-container {
    max-width: 520px;
    width: 100%;
    background: white;
    border-radius: 40px;
    box-shadow: 0 30px 60px -20px rgba(0, 40, 70, 0.4);
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

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

/* Header */
.upload-modal-header {
    background: linear-gradient(115deg, #1f3a4b 0%, #2a4d64 100%);
    padding: 1.5rem 2rem;
    color: white;
    border-bottom: 4px solid #90C63D;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.upload-modal-header h2 {
    font-size: 1.4rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 0;
}

.upload-modal-header h2 i {
    font-size: 1.6rem;
}

.upload-modal-overlay .close-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    width: 36px;
    height: 60px;
    border-radius: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: white;
    font-size: 1.2rem;
}

.upload-modal-overlay .close-btn:hover {
    background: rgba(255,255,255,0.25);
    transform: scale(1.05);
}

/* Body */
.upload-modal-body {
    padding: 2rem;
}

.upload-modal-overlay .tsg-device-content{
    margin-bottom: 1rem;
}

/* Help message */
#uploadModal .help-message {
    background: #eef4fa;
    border-radius: 20px;
    padding: 1rem 1.2rem;
    margin-bottom: 1.8rem;
    border-left: 4px solid #3DB1C4;
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
}

.help-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background: #3DB1C4;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(61, 177, 196, 0.3);
}

.help-message p {
    font-size: 0.85rem;
    color: #1f5a7a;
    line-height: 1.4;
    margin: 0;
}

/* File Upload Zone */
.upload-zone {
    border: 2px dashed #d2e3f0;
    border-radius: 24px;
    padding: 2rem;
    text-align: center;
    background: #f8fafd;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 1rem;
}

.upload-zone:hover {
    border-color: #90C63D;
    background: #eef4fa;
}

.upload-zone.drag-over {
    border-color: #90C63D;
    background: #eef4fa;
    transform: scale(1.02);
}

.upload-zone.has-file {
    border-color: #90C63D;
    border-style: solid;
    background: #eef4fa;
}

.upload-icon {
    font-size: 3rem;
    color: #90C63D;
    margin-bottom: 1rem;
}

.upload-zone h3 {
    font-size: 1rem;
    font-weight: 500;
    color: #1f3a4b;
    margin-bottom: 0.5rem;
}

.upload-zone p {
    font-size: 0.85rem;
    color: #6f8da5;
    margin-bottom: 1rem;
}

.upload-zone .file-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #90C63D;
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 40px;
    display: inline-block;
    margin-top: 0.5rem;
}

.select-file-btn {
    background: #90C63D;
    color: #fff!important;
    border: none;
    padding: 0rem 2rem;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0.5rem;
}

.select-file-btn:hover {
    background: #a2d953;
    transform: scale(1.02);
}

/* Hidden file input */
#fileInput {
    display: none;
}

/* File info */
.file-info {
    background: #f0f6fd;
    border-radius: 16px;
    padding: 1rem;
    margin-top: 1rem;
    display: none;
}

.file-info.show {
    display: block;
}

.file-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.file-info-row:last-child {
    margin-bottom: 0;
}

.file-label {
    font-size: 0.8rem;
    color: #4a6f8b;
}

.file-value {
    font-size: 0.85rem;
    font-weight: 500;
    color: #1f3a4b;
    word-break: break-all;
    text-align: right;
    max-width: 60%;
}

.file-value.success {
    color: #1f7840;
}

.file-remove {
    background: transparent;
    border: none;
    color: #d14545;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.5rem;
    padding: 0.3rem 0;
}

.file-remove:hover {
    color: #b33b3b;
}

/* Format warning */
.format-warning {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #b45b0a;
    background: #fff3d8;
    padding: 0.6rem 1rem;
    border-radius: 12px;
    margin-top: 1rem;
}

.format-warning i {
    font-size: 1rem;
}

/* Progress bar */
.upload-progress {
    margin-top: 1rem;
    display: none;
}

.upload-progress.show {
    display: block;
}

.progress-bar-container {
    background: #e2edf7;
    border-radius: 20px;
    height: 8px;
    overflow: hidden;
}

.progress-bar {
    background: #90C63D;
    height: 100%;
    width: 0%;
    border-radius: 20px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.7rem;
    color: #4a6f8b;
    margin-top: 0.4rem;
    text-align: center;
}

/* Success message */
.success-message {
    background: #e1f7e6;
    border-radius: 16px;
    padding: 1rem;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: #1f7840;
    font-size: 0.9rem;
}

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

/* Upload success state */
.upload-modal-body .success-state {
    text-align: center;
    padding: 1rem 0;
}

.upload-modal-body .success-icon {
    width: 80px;
    height: 80px;
    background: #e1f7e6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    animation: pop 0.4s ease;
}

@keyframes pop {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    80% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.upload-modal-body .success-icon span {
    font-size: 2.5rem;
    color: #1f7840;
    line-height: 1;
}

.upload-modal-body .success-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f7840;
    margin-bottom: 0.5rem;
}

.upload-modal-body .success-state .success-message {
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin: 0 0 1.5rem;
    display: block;
    color: #6f8da5;
    font-size: 1rem;
    line-height: 1.5;
}

.upload-modal-body .tsg-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Error message */
.upload-modal-body .error-message {
    background: #ffe0e0;
    border-radius: 16px;
    padding: 1rem;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: #b33b3b;
    font-size: 0.9rem;
}

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

/* Modal actions */
.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.upload-modal-overlay .btn {
    flex: 1;
    /* padding: 1rem; */
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    border: none;
    font-family: inherit;
    height: 3.5rem;
}

.upload-modal-overlay .preview-image {
    max-width: 100%;
    max-height: 200px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    object-fit: contain;
}

.upload-modal-overlay .upload-zone.has-preview .upload-content {
    display: none;
}
.upload-modal-overlay .btn-primary {
    background: #90C63D;
    color: #fff!important;
    border: 1px solid #6f9e30;
}
.unit-btn.unit-btn-secondary.uploadUnitFile:focus {
    background-color: #3DB1C4!important;
}

.upload-modal-overlay .btn-primary:hover:not(:disabled) {
    background: #a2d953;
    transform: scale(1.02);
}

.upload-modal-overlay .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.upload-modal-overlay .btn-secondary {
    background: transparent;
    border: 2px solid #3DB1C4;
    color: #3DB1C4;
}

.upload-modal-overlay .btn-secondary:hover {
    background: #3DB1C4;
    color: white;
}
.preview-info {
    display: none;
}

.preview-container {
    position: relative;
    width: 100%;
    height: 100%;
    /* padding: 1.5rem; */
    display: flex;
    flex-direction: column;
    align-items: center;
}
.upload-modal-overlay .remove-btn {
    position: absolute;
    top: 0px;
    right: 0px;
    width: 32px;
    height: 52px;
    background: white;
    border: 1px solid #d14545;
    border-radius: 50%;
    color: #d14545;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.upload-modal-overlay .remove-btn:hover {
    background: #ffe0e0;
    transform: scale(1.05);
}
/* Responsive */
@media (max-width: 500px) {
    .upload-modal-container {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
    
    .upload-modal-body {
        padding: 1.5rem;
    }
    
    .modal-actions {
        flex-direction: column;
    }

    .upload-modal-body .tsg-actions {
        flex-direction: column;
    }
    
    .upload-zone {
        padding: 1.5rem;
    }
}
