

/* Share Modal Styles */

    .share-file-notification {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(0.9);
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.5) 0%, rgba(118, 75, 162, 0.5) 100%);
        color: white;
        padding: 20px 30px;
        border-radius: 12px;
        box-shadow: 0 8px 30px rgba(0,0,0,0.3),
                    0 0 0 1px rgba(255,255,255,0.1);
        z-index: 999999;
        min-width: 300px;
        max-width: 400px;
        opacity: 0;
        transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        cursor: pointer;
        overflow: hidden;
        backdrop-filter: blur(10px);
        text-align: center;
    }
    
    .share-file-notification.show {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    
    .share-notification-content {
        position: relative;
        z-index: 2;
    }
    
    .share-notification-title {
        font-weight: 600;
        font-size: 18px;
        margin-bottom: 8px;
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
    }
    
    .share-notification-message {
        font-size: 14px;
        opacity: 0.8;
        color: #eee;
        line-height: 1.4;
    }
    
    .share-notification-progress {
        position: absolute;
        bottom: 0;
        left: 0;
        height: 3px;
        background: linear-gradient(90deg, #4CAF50, #2E7D32);
        width: 100%;
        animation: shareNotificationProgress linear forwards;
        border-radius: 0 0 12px 12px;
    }
    
    /* Success notification */
    .share-file-notification.success {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.4) 0%, rgba(118, 75, 162, 0.4) 100%);
        border: 1px solid rgba(76, 175, 80, 0.3);
    }
    
    .share-file-notification.success .share-notification-progress {
        background: linear-gradient(90deg, #66BB6A, #43A047);
    }
    
    /* Error notification */
    .share-file-notification.error {
        background: rgba(198, 40, 40, 0.9);
        border: 1px solid rgba(239, 83, 80, 0.3);
    }
    
    .share-file-notification.error .share-notification-progress {
        background: linear-gradient(90deg, #EF5350, #D32F2F);
    }
    
    /* Warning notification */
    .share-file-notification.warning {
        background: rgba(245, 124, 0, 0.9);
        border: 1px solid rgba(255, 167, 38, 0.3);
    }
    
    .share-file-notification.warning .share-notification-progress {
        background: linear-gradient(90deg, #FFB74D, #F57C00);
    }
    
    @keyframes shareNotificationProgress {
        from { width: 100%; }
        to { width: 0%; }
    }
    
    /* Pulse animation for success */
    @keyframes pulse {
        0% { transform: scale(1); }
        50% { transform: scale(1.1); }
        100% { transform: scale(1); }
    }
    
    .success-icon {
        animation: pulse 0.5s ease 0.2s;
    }
`;

.share-modal {
    align-items: center;
    justify-content: center;
    z-index: 10050;
}

.share-modal-content {
    background: rgba(255,255,255,0.8);
    border-radius: 12px;
    width: 500px;
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    animation: modalSlideIn 0.3s ease;
	margin:0 auto;
	top: 28px;
position: relative;
}

.share-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.share-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.share-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    line-height: 1;
}

.share-close:hover {
    color: #333;
}

.share-body {
    padding: 20px;
    flex: 1;
    overflow: hidden;
}

.share-file-info {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
}

.share-file-icon {
    width: 50px;
    height: 50px;
    background: #667eea;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
}

.share-file-icon span {
    font-size: 24px;
    color: white;
}

.share-file-details h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
}

.share-file-meta {
    font-size: 13px;
    color: #666;
}

.separator {
    margin: 0 8px;
    color: #ccc;
}

.share-search {
    position: relative;
    margin-bottom: 15px;
}

.share-search-input {
    width: 100%;
    padding: 12px 40px 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border 0.3s;
}

.share-search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.clear-search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    color: #999;
}

.clear-search-btn:hover {
    color: #333;
}

.share-contacts-container {
    flex: 1;
    overflow: hidden;
}

.share-tabs {
    display: flex;
    border-bottom: 1px solid #eee;

}

.share-tab {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.3s;
}

.share-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 500;
}

.share-contacts-list,
.share-groups-list {
    height: 200px;
    overflow-y: auto;
    padding-right: 5px;
	scrollbar-width: thin;
}

.share-contact-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
    margin-bottom: 5px;
}

.share-contact-item:hover {
    background: #f5f7ff;
}

.share-contact-item.selected {
    background: #eef2ff;
    border: 1px solid #667eea;
}

.share-contact-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 4px;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.share-contact-checkbox.checked {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

.share-contact-checkbox.checked::after {
    content: '✓';
    font-size: 12px;
}

.share-contact-avatar {
    width: 40px;
    height: 40px;
    background: #667eea;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: white;
    font-weight: 500;
    flex-shrink: 0;
}

.share-contact-info {
    flex: 1;
    min-width: 0;
}

.share-contact-name {
    font-weight: 500;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.share-contact-identity {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.share-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.share-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.share-selected-count {
    font-size: 14px;
    color: #667eea;
    font-weight: 500;
}

.share-actions {
    display: flex;
    gap: 10px;
}

.share-cancel-btn {
    padding: 8px 20px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.share-cancel-btn:hover {
    background: #f8f9fa;
}

.share-send-btn {
    padding: 8px 20px;
    border: none;
    background: #667eea;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.share-send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.share-send-btn:not(:disabled):hover {
    background: #5a67d8;
}





/* ============ AI EDITOR FULLSCREEN ============ */

.fullscreen-ai-editor {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    backdrop-filter: blur(20px) !important;
    z-index: 99999 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
}

.ai-editor-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;

}

/* ============ HEADER ============ */

.ai-editor-header {
    padding: 10px 25px;
    background: rgba(255,255,255,0.3);
    border-bottom: 1px solid rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    flex-shrink: 0;

}

/* File Info */
.ai-file-info {
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 250px;
}

.ai-file-icon {
    font-size: 24px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.ai-file-details h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #797777;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.ai-file-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
}

.ai-file-separator {
    opacity: 0.5;
}

/* AI Tools Bar */
.ai-tools-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.ai-action-buttons {
    display: flex;
    gap: 8px;

}

.ai-tool-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.6) 0%, rgba(118, 75, 162, 0.6) 100%);
    border: 1px solid rgba(102, 126, 234, 0.25);
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.ai-tool-btn:hover {
    background: rgba(102, 126, 234, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.ai-tool-icon {
    font-size: 14px;
}

.ai-tool-text {
    font-size: 13px;
}

/* AI Chat Input */
.ai-chat-input-container {
    display: flex;
    align-items: center;
    gap: 10px;
	width:100%;
	padding:5px;
}

.ai-chat-input {
    flex: 1;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    transition: all 0.2s;
}

.ai-chat-input:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.ai-chat-send {
    padding: 10px 16px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.ai-chat-send:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* Control Buttons */
.ai-control-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-control-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.save-btn {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.preview-btn {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.close-btn {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.ai-control-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ============ MAIN CONTENT - 2 РАВНИ ПАНЕЛА ============ */

.ai-main-content {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    gap: 1px;
    background: rgba(102, 126, 234, 0.1);
}

/* Left Panel - AI Responses */
.ai-response-panel {
    flex: 1;
    width: 50%;
    background: rgba(30, 41, 59, 0.95);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ai-panel-header {
    padding: 15px 20px;
    background: rgba(15, 23, 42, 0.9);
    border-bottom: 1px solid rgba(102, 126, 234, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.ai-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
}

.ai-panel-icon {
    font-size: 18px;
}

.ai-panel-title h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.ai-response-count {
    background: rgba(102, 126, 234, 0.2);
    color: #c7d2fe;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.ai-clear-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.ai-clear-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* AI Responses Container */
.ai-responses-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
	scrollbar-width: thin;
}

.ai-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    text-align: center;
    padding: 40px 20px;
}

.ai-empty-icon {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.ai-empty-state p {
    margin: 5px 0;
    font-size: 14px;
    line-height: 1.6;
}

/* AI Message Styles */
.ai-message {
    background: rgba(15, 23, 42, 0.8);
    border-radius: 10px;
    padding: 16px;
    animation: messageAppear 0.3s ease;
}

@keyframes messageAppear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-message-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
}

.ai-message-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #c7d2fe;
    font-size: 14px;
    font-weight: 600;
}

.ai-message-time {
    color: #94a3b8;
    font-size: 12px;
    font-weight: 500;
}

.ai-message-content {
    color: #fff;
    font-size: 16px;
    line-height: 1.6;
}

.ai-message-content pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 10px 0;
    font-family: 'Consolas', monospace;
    font-size: 13px;
}

.ai-message-content code {
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', monospace;
    font-size: 13px;
}

/* Right Panel - Code Editor */
.code-editor-panel {
    flex: 1;
    width: 50%;
    background: #1e1e1e;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.editor-toolbar {
    padding: 12px 20px;
    background: #252526;
    border-bottom: 1px solid #3e3e42;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.editor-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.editor-cursor {
    color: #cccccc;
    font-size: 13px;
    font-family: 'Consolas', monospace;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 4px;
}

.editor-status {
    color: #34d399;
    font-size: 13px;
    font-weight: 500;
    background: rgba(52, 211, 153, 0.1);
    padding: 4px 10px;
    border-radius: 4px;
}

.editor-actions {
    display: flex;
    gap: 8px;
}

.editor-action-btn {
    padding: 6px 12px;
    background: #2d2d30;
    border: 1px solid #3e3e42;
    color: #cccccc;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.editor-action-btn:hover {
    background: #3e3e42;
    color: white;
}

/* Editor Container */
.editor-container {
    flex: 1;
    min-height: 0;
    position: relative;
}

.editor-monaco-container,
.editor-fallback {
    width: 100%;
    height: 100%;
}

.editor-fallback {
    padding: 20px;
    background: #fff;
    color: #000;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.6;
    border: none;
    resize: none;
    outline: none;
	scrollbar-width: thin;
}

/* Footer */
.editor-footer {
    padding: 10px 20px;
    background: #007acc;
    color: white;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 25px;
    flex-shrink: 0;
}

.footer-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-label {
    opacity: 0.8;
    font-weight: 500;
}

/* Scrollbar Styles */
.ai-responses-container::-webkit-scrollbar,
.editor-fallback::-webkit-scrollbar {
    width: 10px;
}

.ai-responses-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 5px;
}

.ai-responses-container::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 5px;
}

.ai-responses-container::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.7);
}

/* ============ RESPONSIVE ============ */

@media (max-width: 1400px) {
    .ai-editor-header {
        padding: 10px 15px;
        gap: 15px;
    }
    
    .ai-file-info {
        min-width: 200px;
    }
    
    .ai-file-details h3 {
        max-width: 150px;
    }
    
    .ai-tools-bar {
        flex-direction: column;
        gap: 10px;
    }
    
    .ai-chat-input-container {
        max-width: 100%;
    }
}

@media (max-width: 1024px) {
    .ai-main-content {
        flex-direction: column;
    }
    
    .ai-response-panel,
    .code-editor-panel {
        width: 100%;
        height: 50vh;
    }
}

@media (max-width: 768px) {
    .ai-editor-header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .ai-tools-bar {
        width: 100%;
    }
    
    .ai-action-buttons {
        justify-content: center;
    }
    
    .ai-control-buttons {
        width: 100%;
        justify-content: center;
    }
    
    .editor-footer {
        flex-wrap: wrap;
        gap: 15px;
        justify-content: center;
    }
}









/* Manually Delete File Modal Styles */
#manuallyDeleteFileModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

#manuallyDeleteFileModal .modal-dialog {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 420px;
    padding: 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: manually-modal-appear 0.3s ease;
    overflow: hidden;
}

@keyframes manually-modal-appear {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

#manuallyDeleteFileModal .modal-header {
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    background: linear-gradient(to right, #fef2f2, #ffffff);
}

#manuallyDeleteFileModal .modal-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #fecaca, #f87171);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    flex-shrink: 0;
}

#manuallyDeleteFileModal .modal-icon svg {
    width: 22px;
    height: 22px;
    color: #dc2626;
}

#manuallyDeleteFileModal .modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    flex-grow: 1;
}

#manuallyDeleteFileModal .modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

#manuallyDeleteFileModal .modal-close:hover {
    background: #f3f4f6;
    color: #6b7280;
}

#manuallyDeleteFileModal .modal-body {
    padding: 24px;
}

#manuallyDeleteFileNameText {
    margin: 0 0 16px 0;
    font-size: 16px;
    color: #374151;
    line-height: 1.5;
    font-weight: 500;
}

#manuallyDeleteFileModal .modal-warning {
    margin: 0;
    font-size: 14px;
    color: #dc2626;
    background: #fef2f2;
    padding: 14px;
    border-radius: 8px;
    border-left: 4px solid #f87171;
    line-height: 1.5;
}

#manuallyDeleteFileModal .modal-footer {
    padding: 20px 24px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: #f9fafb;
}

#manuallyDeleteFileModal .modal-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    min-width: 80px;
}

#manuallyDeleteFileModal .modal-btn-cancel {
    background: white;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

#manuallyDeleteFileModal .modal-btn-cancel:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

#manuallyDeleteFileModal .modal-btn-delete {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: 1px solid #ef4444;
}

#manuallyDeleteFileModal .modal-btn-delete:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

/* Анимация за изтриване на файл елемент */
.files-item.deleting {
    transition: all 0.3s ease;
    transform: translateX(100%);
    opacity: 0;
}

.files-modal {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.4) 0%, rgba(118, 75, 162, 0.4) 100%);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    width: 97%;
    height: 93%;
    margin: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
}

.files-header {
    padding: 5px 30px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 20px 20px 0 0;
}

.files-header h2 {
    margin: 0;
    color: #888;
    font-size: 18px;
    font-weight: 600;
}

.close-files {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #6b7280;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-files:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #374151;
}

.files-container {
    padding: 30px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* Скролбар стилове */
.files-container::-webkit-scrollbar {
    width: 8px;
}

.files-container::-webkit-scrollbar-track {
    background: rgba(241, 241, 241, 0.3);
    border-radius: 4px;
}

.files-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.files-container::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* Нова структура на файл елемента - хоризонтална подредба */
.files-item {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(15px);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    min-height: auto;
    display: flex;
    flex-direction: column;
    padding: 8px;
    position: relative;
	height:100px;
}

.files-item-content {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
    position: relative;
    padding-left: 50px; /* Отстъп за иконата отляво */
    min-height: 40px;
}

.files-item-icon-left {
    position: absolute;
    left: 0;
    top: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #667eea;
}

.files-item-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.files-item-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
	max-width: calc(39vw - 350px);
}

.files-actions-right {
    display: flex;
    gap: 8px;
    justify-content: flex-end;

}
.files-item-icon-left svg {
    width: 50px;
    height: 50px;
    fill: currentColor; 
}

.files-item-icon-left {
    color: #fff; 
}


/* SVG икони */
.svg-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0;
}

.svg-icon:hover {
    background: rgba(255, 255, 255, 1);
}

.svg-icon svg {
    width: 16px;
    height: 16px;
}

.files-item-details {
    display: flex;
    justify-content: space-between;
	margin-top:15px;

}

.files-item-size {
    color: #000;
    font-size: 12px;
    font-weight: 500;
}

.files-item-extension {
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    background: rgba(102, 126, 234, 0.5);
    padding: 2px 8px;
    border-radius: 12px;
}

.files-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
    font-size: 18px;
}

/* Табове и контроли */
.files-tabs {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.files-controls-tab {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.files-tab {
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    color: #999999;
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    white-space: nowrap;
}

.files-tab:hover {
    color: #fff;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.4) 0%, rgba(118, 75, 162, 0.4) 100%);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.files-tab.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.4) 0%, rgba(118, 75, 162, 0.4) 100%);
    border: none;
}

.files-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

#filesSearchInput {
    padding: 8px 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    width: 250px;
}

.files-controls button {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: rgba(107, 114, 128, 0.9);
    color: white;
    cursor: pointer;
    font-size: 14px;
}

.files-controls button:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.4) 0%, rgba(118, 75, 162, 0.4) 100%);
}

/* Audio modal */
.thia-modal.audio-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    background: transparent;
    border: none;
    box-shadow: none;
}

.audio-modal-content {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.4) 0%, rgba(118, 75, 162, 0.4) 100%);
    border-radius: 16px;
    width: 600px;
    max-width: 95vw;
    padding: 20px;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 0px 10px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 80vh;
    overflow-y: auto;
	left: 10px;
    top: 10px;
}

/* Top header with buttons */
.audio-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Control buttons container in top right corner */
.audio-header-controls {
    display: flex;
    gap: 8px;
    position: absolute;
    top: 3px;
    right: 15px;
}

/* Individual buttons */
.audio-minimize,
.audio-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    margin: 0;
}

.audio-minimize:hover,
.audio-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.audio-minimize:active,
.audio-close:active {
    transform: scale(0.95);
}

/* Audio player */
.audio-player-container {
    margin: 20px 0 15px;
}

#jsFileAudioPlayer {
    width: 100%;
    border-radius: 8px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
}

#jsFileAudioPlayer::-webkit-media-controls-panel {
    background: rgba(0, 0, 0, 0.7);
}

#jsFileAudioPlayer::-webkit-media-controls-current-time-display,
#jsFileAudioPlayer::-webkit-media-controls-time-remaining-display {
    color: white;
}

/* File info */
.audio-info {
    color: white;
    text-align: center;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.audio-filename {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
}

.audio-playlist-info {
    font-size: 12px;
    color: #fff;
    margin-top: 5px;
}

/* Playlist section */
.audio-playlist-section {
    margin: 20px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
}

.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.playlist-header h3 {
    color: white;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.playlist-container {
    max-height: 200px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.3);
	scrollbar-width: thin;
}

.playlist-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
}

.playlist-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.playlist-item.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border-left: 3px solid #667eea;
}

.playlist-item-number {
    color: #fff;
    font-size: 12px;
    min-width: 25px;
}

.playlist-item-name {
    color: white;
    font-size: 13px;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 10px;
}

.playlist-item-play {
    background: rgba(102, 126, 234, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 10px;
    transition: all 0.2s ease;
    padding: 0;
    flex-shrink: 0;
}

.playlist-item-play svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    margin-left: 1px;
}

.playlist-item-play:hover {
    background: rgba(102, 126, 234, 0.4);
    transform: scale(1.1);
}

.playlist-empty {
    color: #a0a0a0;
    text-align: center;
    padding: 20px;
    font-size: 13px;
}

/* Scrollbar styling for playlist */
.playlist-container::-webkit-scrollbar {
    width: 6px;
}

.playlist-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.playlist-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.playlist-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Play all controls */
.audio-playall-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
    align-items: center;
}

.playall-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    width: 100%;
    flex-wrap: wrap;
}

.audio-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.6) 0%, rgba(118, 75, 162, 0.6) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 120px;
    height: 48px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    line-height: 1;
}

.audio-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.3);
}

.audio-btn:active {
    transform: translateY(0);
}

/* Icon styling */
.btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.audio-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
    flex-shrink: 0;
}

.btn-content span {
    line-height: 1;
    white-space: nowrap;
}
/* Text styling */
.audio-btn span {
    line-height: 1;
}

/* Button color variations */
.playall-btn {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.7) 0%, rgba(39, 174, 96, 0.7) 100%) !important;
}

.playall-btn:hover {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.9) 0%, rgba(39, 174, 96, 0.9) 100%) !important;
    box-shadow: 0 6px 16px rgba(46, 204, 113, 0.3) !important;
}

.pause-btn {
    background: linear-gradient(135deg, rgba(241, 196, 15, 0.7) 0%, rgba(243, 156, 18, 0.7) 100%) !important;
}

.pause-btn:hover {
    background: linear-gradient(135deg, rgba(241, 196, 15, 0.9) 0%, rgba(243, 156, 18, 0.9) 100%) !important;
    box-shadow: 0 6px 16px rgba(241, 196, 15, 0.3) !important;
}

.resume-btn {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.7) 0%, rgba(41, 128, 185, 0.7) 100%) !important;
}

.resume-btn:hover {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.9) 0%, rgba(41, 128, 185, 0.9) 100%) !important;
    box-shadow: 0 6px 16px rgba(52, 152, 219, 0.3) !important;
}

.stop-btn {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.7) 0%, rgba(192, 57, 43, 0.7) 100%) !important;
}

.stop-btn:hover {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.9) 0%, rgba(192, 57, 43, 0.9) 100%) !important;
    box-shadow: 0 6px 16px rgba(231, 76, 60, 0.3) !important;
}

/* Playlist status */
.playall-status {
    color: #fff;
    font-size: 12px;
    text-align: center;
    min-height: 18px;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    transition: opacity 0.3s ease;
}

.playall-status:empty {
    opacity: 0;
}

/* Current playing file style in main list */
.files-item.currently-playing {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border-left: 4px solid #667eea;
    border-right: 1px solid rgba(102, 126, 234, 0.3);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.15);
    transform: translateX(2px);
    transition: all 0.3s ease;
}

.files-item.currently-playing .files-item-name {
    color: #667eea;
    font-weight: 600;
}

.files-item.currently-playing .play-icon svg {
    fill: #667eea;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

/* Paused state for playlist items */
.playlist-item.paused {
    background: linear-gradient(135deg, rgba(241, 196, 15, 0.15) 0%, rgba(243, 156, 18, 0.15) 100%);
    border-left: 3px solid #f1c40f;
}

/* MINIMIZED WINDOW STYLES (BOTTOM LEFT CORNER) */
.audio-modal.minimized {
    width: 320px !important;
    height: auto !important;
    bottom: 20px !important;
    left: 20px !important;
    top: auto !important;
    right: auto !important;
    position: fixed !important;
    border-radius: 12px !important;
    padding: 12px !important;
    transform: none !important;
    margin: 0 !important;
    z-index: 10001 !important;
    max-width: calc(100vw - 40px) !important;
}

.audio-modal.minimized .audio-modal-content {
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px !important;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.4) 0%, rgba(118, 75, 162, 0.4) 100%) !important;
}

.audio-modal.minimized .audio-player-container,
.audio-modal.minimized .audio-playall-controls,
.audio-modal.minimized .audio-playlist-section {
    display: none !important;
}

.audio-modal.minimized .audio-info {
    margin: 0 !important;
    padding: 8px 40px 8px 12px !important;
    background: transparent !important;
    text-align: left !important;
}

.audio-modal.minimized .audio-filename {
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #fff !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 200px !important;
}

/* Buttons remain visible in minimized mode */
.audio-modal.minimized .audio-header-controls {
    top: 8px !important;
    right: 8px !important;
}

.audio-modal.minimized .audio-minimize,
.audio-modal.minimized .audio-close {
    width: 28px !important;
    height: 28px !important;
    font-size: 16px !important;
    background: rgba(255, 255, 255, 0.2) !important;
}

/* Animations */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -48%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.thia-modal.audio-modal[style*="display: block"] {
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes minimizeToCorner {
    from {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 600px;
        max-width: 95vw;
    }
    to {
        bottom: 20px;
        left: 20px;
        transform: none;
        width: 320px;
    }
}

.audio-modal.minimized {
    animation: minimizeToCorner 0.3s ease-out;
}


/* Ensure proper spacing in playlist items */
.playlist-item > *:first-child {
    margin-right: 8px;
}

.playlist-item > *:last-child {
    margin-left: auto;
}

/* Редактор модал */
.editor-modal-content {
    background: white;
    border-radius: 16px;
    width: 800px;
    max-width: 90vw;
    height: 600px;
    max-height: 90vh;
    padding: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
}

.editor-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    color: #374151;
    font-size: 24px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.editor-header {
    margin-bottom: 20px;
}

.editor-header h3 {
    margin: 0;
    color: #374151;
}

.editor-body {
    flex: 1;
    margin-bottom: 20px;
}

#fileEditorContent {
    width: 100%;
    height: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: none;
}

.editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.editor-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.save-btn {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.4) 0%, rgba(118, 75, 162, 0.4) 100%);
    color: white;
}

.save-btn:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.6) 0%, rgba(118, 75, 162, 0.6) 100%);
}

.cancel-btn {
    background: #f3f4f6;
    color: #374151;
}

.cancel-btn:hover {
    background: #e5e7eb;
}

/* Мобилни контроли */
.mobile-files-controls {
    display: none;
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 15px;
}

.mobile-search-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

#mobileFilesSearch {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

.mobile-search-container button {
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    background: rgba(107, 114, 128, 0.9);
    color: white;
    cursor: pointer;
    min-width: 50px;
}

.mobile-tabs {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.mobile-tab {
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    color: #999999;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

.mobile-tab.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.4) 0%, rgba(118, 75, 162, 0.4) 100%);
    border: none;
}

.files-item:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.4) 0%, rgba(118, 75, 162, 0.4) 100%);
}

/* Ховър за затварящия бутон */
.close-files:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #374151;
}

/* Ховър за SVG икони */
.svg-icon:hover {
    background: rgba(255, 255, 255, 1);
}
