/* Modern Uploader Styles */
.myFileInput {
    opacity: 0;
    position: absolute;
    width: 1px;
    height: 1px;
}

.myFileLabel {
    display: block;
    cursor: pointer;
    width: auto;
}

.upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s ease;
    background: #fafafa;
    margin: 10px 0;
}

.upload-area:hover,
.drag-over .upload-area {
    border-color: #3b82f6;
    background: #f0f9ff;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.7;
}

.myFileBlock {
    padding: 20px;
    margin: 20px 20px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e5e7eb;
    min-height: 200px;
    position: relative;
    width: 80%;
    word-break: break-all;
}

.upload-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 20px 0;
    align-items: center;
}

.upload-type-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    background: #3b82f6;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
}

.upload-type-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-icon {
    font-size: 16px;
}

/* Специфичные стили для кнопки Загрузить */
.upload-submit-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    background: #10b981;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    min-height: auto;
    height: auto;
}

.upload-submit-btn::before {
    content: "📤";
    font-size: 16px;
}

.upload-submit-btn:hover:not(:disabled) {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.upload-submit-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.rotation-hint {
    font-size: 14px;
    font-weight: 500;
    animation: fadeInOut 1s ease-in-out;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translate(-50%, -40%); }
    20% { opacity: 1; transform: translate(-50%, -50%); }
    80% { opacity: 1; transform: translate(-50%, -50%); }
    100% { opacity: 0; transform: translate(-50%, -60%); }
}

/* File Items */
.myItemBlock {
    position: relative;
    display: inline-block;
    margin: 8px;
    vertical-align: top;
    animation: slideIn 0.3s ease;
}

.myImgList {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    transition: transform 0.3s ease;
    transform-origin: center center;
}

.myImgList:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.myFileIcon {
    width: 150px;
    height: 150px;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    background: #f8fafc;
}

.myFileSizeBlock {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* Buttons */
.myRotateButton {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 25px;
    height: 25px;
    background: rgba(0,0,0,0.7) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M12 6v3l4-4-4-4v3c-4.42 0-8 3.58-8 8 0 1.57.46 3.03 1.24 4.26L6.7 14.8c-.45-.83-.7-1.79-.7-2.8 0-3.31 2.69-6 6-6zm6.76 1.74L17.3 9.2c.44.84.7 1.79.7 2.8 0 3.31-2.69 6-6 6v-3l-4 4 4 4v-3c4.42 0 8-3.58 8-8 0-1.57-.46-3.03-1.24-4.26z"/></svg>') no-repeat 50% 50%;
    background-size: 16px 16px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    border: 1px solid rgba(255,255,255,0.3);
}

.myRotateButton:hover {
    background-color: rgba(0,0,0,0.9);
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Кнопка удаления - ИСПРАВЛЕНА */
.myDelButton {
    display: none; /* По умолчанию скрыта */
    height: 25px;
    width: 25px;
    z-index: 10;
    background: rgba(229, 57, 70, 0.9);
    border-radius: 50%;
    opacity: 0.9;
    cursor: pointer;
    transition: all 0.3s ease;
    position: absolute;
    top: 8px;
    right: 8px;
    border: none;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    backdrop-filter: blur(10px);
}

.myDelButton::before {
    content: "×";
}

/*
.myDelButton:hover {
    opacity: 1 !important;
    transform: scale(1.1);
    background: rgb(229, 57, 70);
}*/

/* Убираем конфликтующий стиль */
/* .myPrewDel {
    display: flex !important;
} */

/* Показываем кнопку удаления при hover на desktop */
@media (hover: hover) and (pointer: fine) {
    .showInfo:hover .myDelButton {
        display: flex !important;
    }
}

/* Progress Bars */
.progress-bar-container {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 5px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(45deg, #3b82f6, #10b981);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3px;
}

.progress-text {
    font-size: 11px;
    font-weight: 600;
    color: #374151;
}

.progress-percent {
    font-size: 11px;
    font-weight: bold;
    color: #3b82f6;
}

.myAbsProgress {
    position: absolute;
    bottom: 35px;
    left: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.95);
    padding: 8px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.myShowProgressBar {
    position: relative;
    width: 100%;
    display: none;
}

.myProgressResult {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: white;
    z-index: 2;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

progress.css3 {
    width: 100%;
    height: 20px;
    border-radius: 10px;
    border: none;
    background: #e5e7eb;
    overflow: hidden;
}

progress.css3::-webkit-progress-bar {
    background: #e5e7eb;
    border-radius: 10px;
}

progress.css3::-webkit-progress-value {
    background: linear-gradient(45deg, #3b82f6, #10b981);
    border-radius: 10px;
    transition: width 0.3s ease;
}

progress.css3::-moz-progress-bar {
    background: linear-gradient(45deg, #3b82f6, #10b981);
    border-radius: 10px;
}

/* Messages */
.myShowUploaderMsg {
    position: absolute;
    display: none;
    top: 5px;
    left: 5px;
    z-index: 9999;
    cursor: pointer;
    height: auto;
    width: auto;
    border-radius: 5px;
    background: rgba(0,0,0,.7);
    animation: myShowUploaderMsg 2s linear infinite;
    font-weight: bold;
    color: #F00;
    padding: 5px;
}

@keyframes myShowUploaderMsg {
    0% { color: #F00; }
    50% { color: #FBB; }
    100% { color: #F00; }
}

/* Кнопка информации */
.myInfoButton {
    position: absolute;
    cursor: pointer;
    top: 3px;
    right: 3px;
    height: 20px;
    width: 20px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23000"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/></svg>') 50% 50% no-repeat;
    background-size: contain;
    z-index: 999;
}

.myInfoButton:hover {
    opacity: 1;
}

/* Original styles (preserved for compatibility) */
.myFileBlockMin {
    text-align: center;
    border: 1px dotted rgba(195,182,182,.9);
    border-radius: 4px;
    min-height: 40px;
    width: auto;
    margin-top: 5px;
}

.myButtonRed {
    font-size: 14px;
    line-height: 20px;
    cursor: pointer;
    background: #DF314D;
    color: #fff;
    width: auto;
    margin: 5px;
    padding: 5px 10px 5px 10px;
    border-radius: 3px;
    text-align: center;
}

.myInline {
    display: inline-block;
}

.myCheckBoxInFile {
    display: none;
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1;
    align-items: center;
    justify-content: center;
}

/* Базовые стили для меню */
.myMobileMenu {
    display: none; /* По умолчанию скрыто */
    height: 16px;
    width: 16px;
    z-index: 10;
    border-radius: 0 3px 0 3px;
    cursor: pointer;
    position: absolute;
    top: 12px;
    right: 12px;
    opacity: 0.85;
    background: #1d2022;
    padding: 5px 0 0 3px;
    margin: 0 0 10px 10px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.myMenuIcon {
    height: 2px;
    width: 12px;
    background: #fff;
    border-radius: 1px;
    margin-bottom: 2px;
}


/* Для touch устройств - начальное состояние */
@media (hover: none) and (pointer: coarse) {
    .myMobileMenu {
        display: flex !important;
    }
    
    
    .myCheckBoxInFile,
    .myBlockInfo {
        display: none !important;
    }
}


/* Для desktop - hover эффекты */
@media (hover: hover) and (pointer: fine) {
    .myMobileMenu {
        display: none !important;
    }

       .myCheckBoxInFile,
    .myBlockInfo {
        display: none !important;
    }
    
    .showInfo:hover .myDelButton,
    .showInfo:hover .myCheckBoxInFile {
        display: flex !important;
        opacity: 1;
        transform: scale(1);
    }
    
    .showInfo:hover .myBlockInfo {
        display: block !important;
        opacity: 1;
        transform: scale(1);
    }
}

.myGifPlayIcon {
    position: absolute;
    top: 50%;
    left: 50%;
    margin-left: -25px;
    margin-top: -25px;
    height: 50px;
    width: 50px;
    border-radius: 50%;
    background: #000;
    background: rgba(0,0,0,.5) url(./images/video_play_small.png?1) 19px 13px no-repeat;
    -o-transition: background-color 100ms linear;
    transition: background-color 100ms linear;
    will-change: opacity;
    z-index: 1;
}

.myBlockInfo {
    position: absolute;
    bottom: 5px;
    width: 100%;
    text-align: center;
    display: none;
}

.mySubmitbt {
    display: inline-block;
    font-family: arial,sans-serif;
    font-size: 11px;
    font-weight: bold;
    color: rgb(68,68,68);
    text-decoration: none;
    padding: .2em 0.6em;
    outline: none;
    border: 1px solid rgba(0,0,0,.1);
    border-radius: 2px;
    background: rgb(245,245,245);
    transition: all .218s ease 0s;
}

.myBcopy {
    width: 110px;
    margin-top: 3px;
    margin-bottom: 7px;
    cursor: pointer;
}

.myCopyInfo {
    position: absolute;
    opacity: 0;
    width: 100px;
    word-break: break-all;
}

.buttonRedDisabled {
    background-color: #ee8208;
    opacity: .5;
    cursor: default;
    color: #fff;
    width: auto;
    margin: 5px;
    padding: 5px 10px 5px 10px;
    border-radius: 3px;
    text-align: center;
}

.myInfoReturnStatusVideo {
    position: absolute;
    right: 0;
    left: 5px;
    z-index: 9999;
    cursor: pointer;
    height: auto;
    width: 200px;
    border-radius: 5px;
    background: rgba(0,0,0,.7);
    animation: myInfoReturnStatusVideo 2s linear infinite;
    font-weight: bold;
    color: #F00;
    padding: 5px;
}

@keyframes myInfoReturnStatusVideo {
    0% { color: #F00; }
    50% { color: #FBB; }
    100% { color: #F00; }
}

.filesLoadMenu {
    position: absolute;
    bottom: 45px;
    background: #fff;
    border-radius: 5px;
    padding: 5px;
    margin-left: 9px;
    width: 120px;
    left: -110px;
    min-height: 105px;
    height: auto;
    text-align: center;
    box-shadow: 0 1px 0 0 #d7d8db,0 0 0 1px #e3e4e8;
}

.fileRenameVideo {
    width: auto;
    min-width: 150px;
    background: rgba(0,0,0,.7);
    color: #fff;
    font-size: 14px;
    line-height: 28px;
    text-align: left;
    height: 30px;
    border-radius: 5px;
    padding: 0 5px 0 5px;
    word-wrap: break-word;
    overflow-x: hidden;
    margin-right: 10px;
}

#buttonTitleSend {
    text-align: center;
    border-radius: 3px;
    color: #FFF;
    line-height: 30px;
    display: inline-block;
    width: 45px;
    height: 30px;
    background: linear-gradient(to bottom, #32374a, #0c1224);
    cursor: pointer;
}

.buttonTitleChangeNo {
    text-align: center;
    border-radius: 3px;
    color: #FFF;
    line-height: 30px;
    display: inline-block;
    width: 120px;
    height: 30px;
    background: linear-gradient(to bottom, #32374a, #0c1224);
    cursor: pointer;
}

.buttonTitleChange {
    position: absolute;
    right: 0;
    left: 5px;
    top: 25px;
    z-index: 9999;
    text-align: center;
    border-radius: 3px;
    color: #FFF;
    line-height: 30px;
    display: inline-block;
    width: 120px;
    height: 30px;
    background: linear-gradient(to bottom, #32374a, #0c1224);
    cursor: pointer;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .upload-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .upload-type-btn,
    .upload-submit-btn {
        width: 100%;
        justify-content: center;
    }
    
    .myItemBlock {
        margin: 4px;
    }
    
    .myImgList {
        width: 120px;
        height: 120px;
    }
}

/* Плавные переходы для элементов управления */
.myDelButton,
.myCheckBoxInFile,
.myBlockInfo,
.myMobileMenu {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Для touch устройств с активным классом */
.showInfo.mobile-active .myMobileMenu {
    display: none !important;
    opacity: 0;
    transform: scale(0.8);
}

.showInfo.mobile-active .myBlockInfo {
    display: block !important;
    opacity: 1;
    transform: scale(1);
}

.showInfo.mobile-active .myDelButton {
    display: flex !important;
    opacity: 1;
    transform: scale(1);
}

.showInfo.mobile-active .myCheckBoxInFile {
    display: flex !important;
    opacity: 1;
    transform: scale(1);
}

/* Начальное состояние для анимации */
.myBlockInfo,
.myCheckBoxInFile {
    opacity: 0;
    transform: scale(0.8);
}

/* Индикатор активного состояния для мобильных */
.showInfo.mobile-active {
    box-shadow: 0 0 0 2px #3b82f6;
    border-radius: 8px;
}

.attachFileBtn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 6px 12px 6px 10px !important;
    background: transparent !important;
    border: none !important;
    border-radius: 20px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    color: #65676b !important;
    flex-shrink: 0 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
}

.attachFileBtn:hover {
    background: #f0f2f5 !important;
    color: #0095ff !important;
}

.attachFileBtn svg {
    width: 20px !important;
    height: 20px !important;
    stroke: currentColor !important;
    fill: none !important;
}

.attachFileBtn .attachLabel {
    display: inline !important;
}

/* ==========================================
   ЗАГЛУШКИ ДЛЯ ФАЙЛОВ
   ========================================== */

.file-placeholder {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    background: #f0f4f8;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.file-placeholder .file-icon { font-size: 48px; line-height: 1; margin-bottom: 8px; }
.file-placeholder .file-extension { font-size: 12px; font-weight: 600; text-transform: uppercase; color: #4a5568; background: rgba(255,255,255,0.8); padding: 2px 12px; border-radius: 12px; }
.file-placeholder .file-name { font-size: 11px; color: #718096; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 4px; }

/* Цветовые схемы (соответствуют CSS-классам из конфига) */
.file-placeholder.type-doc { background: linear-gradient(135deg, #ebf4ff 0%, #dbeafe 100%); border-color: #93c5fd; }
.file-placeholder.type-doc .file-icon { color: #2563eb; }

.file-placeholder.type-image { background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%); border-color: #6ee7b7; }
.file-placeholder.type-image .file-icon { color: #059669; }

.file-placeholder.type-video { background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%); border-color: #fca5a5; }
.file-placeholder.type-video .file-icon { color: #dc2626; }

.file-placeholder.type-audio { background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%); border-color: #c4b5fd; }
.file-placeholder.type-audio .file-icon { color: #7c3aed; }

.file-placeholder.type-archive { background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%); border-color: #fcd34d; }
.file-placeholder.type-archive .file-icon { color: #d97706; }

.file-placeholder.type-code { background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%); border-color: #94a3b8; }
.file-placeholder.type-code .file-icon { color: #1e293b; }

.file-placeholder.type-pdf { background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%); border-color: #f87171; }
.file-placeholder.type-pdf .file-icon { color: #dc2626; }

.file-placeholder.type-spreadsheet { background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%); border-color: #34d399; }
.file-placeholder.type-spreadsheet .file-icon { color: #059669; }

.file-placeholder.type-presentation { background: linear-gradient(135deg, #fffbeb 0%, #fde68a 100%); border-color: #fbbf24; }
.file-placeholder.type-presentation .file-icon { color: #d97706; }
