/* Path: T2Editor/plugin/file/file.css */

.t2-file-editor-modal { background: #fff; border-radius: 12px; box-shadow: 0 4px 24px rgba(0,0,0,.12); padding: 24px; width: 480px; max-width: 90vw; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui; }
.t2-file-editor-modal h3 { font-size: 20px; font-weight: 600; color: #1a1a1a; margin: 0 0 20px 0; }
.t2-file-upload-area { border: 2px dashed #e5e7eb; border-radius: 8px; padding: 32px 16px; text-align: center; cursor: pointer; transition: all 0.2s; margin-bottom: 20px; position: relative; }
.t2-file-upload-area:hover { border-color: #2563eb; background: rgba(37,99,235,.05); }
.t2-file-upload-area.drag-over { border-color: #2563eb; background: rgba(37,99,235,.05); }
.t2-file-upload-area .material-icons { font-size: 48px; color: #6b7280; margin-bottom: 12px; }
.t2-file-upload-text { font-size: 15px; color: #4b5563; margin-bottom: 4px; }
.t2-file-upload-hint { font-size: 13px; color: #6b7280; }
.t2-file-upload-area input[type="file"] { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.t2-file-preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 16px; margin: 20px 0; max-height: 300px; overflow-y: auto; padding: 4px; }
.t2-file-preview-item { position: relative; display: flex; flex-direction: column; align-items: center; padding: 12px; border-radius: 8px; background: #f9fafb; transition: all 0.2s; }
.t2-file-preview-item:hover { background: #f3f4f6; }
.t2-file-preview-icon { width: 48px; height: 60px; background-color: #E8B56F; border-radius: 6px; margin-bottom: 8px; position: relative; overflow: hidden; }
.t2-file-preview-icon::before { content: ''; position: absolute; top: 0; right: 0; width: 16px; height: 16px; background: linear-gradient(135deg, rgba(255,255,255,.12) 0%, rgba(255,255,255,0) 100%); }
.t2-file-preview-icon::after { content: ''; position: absolute; top: 0; right: 0; width: 0; height: 0; border-style: solid; border-width: 8px; border-color: #fff #fff transparent transparent; }
.t2-file-preview-name { font-size: 13px; color: #374151; text-align: center; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 4px; }
.t2-file-preview-remove { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.5); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; transition: opacity 0.2s; }
.t2-file-preview-item:hover .t2-file-preview-remove { opacity: 1; }
.t2-file-preview-remove:hover { background: rgba(0,0,0,.7); }
.t2-file-preview-remove .material-icons { font-size: 14px; }
.t2-btn-group { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }
.t2-btn[data-action="cancel"] { color: #4b5563; background: #f3f4f6; }
.t2-btn[data-action="cancel"]:hover { background: #e5e7eb; }
.t2-btn[data-action="upload"] { color: #fff; background: #2563eb; }
.t2-btn[data-action="upload"]:hover:not(:disabled) { background: #1d4ed8; }
.t2-btn[data-action="upload"]:disabled { background: #93c5fd; cursor: not-allowed; }

.t2-file-block { margin: 10px 0; }
.file-container { width: 100%; min-width: 280px; max-width: 360px; aspect-ratio: 4/1; background: #fff; border-radius: 12px; border: 1px solid #4a4a4a; padding: 0 20px; display: flex; align-items: center; font-family: 'Roboto', Arial, sans-serif; transition: all 0.2s ease; box-sizing: border-box; cursor: pointer; }
.t2-file-block .file-container:hover { transform: translateY(-1px); background-color: #f8f9fa; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.t2-file-block .file-icon { position: relative; width: 42px; height: 52px; background-color: #E8B56F; border-radius: 6px; margin-right: 20px; flex-shrink: 0; overflow: hidden; }
.t2-file-block .file-icon::before { content: ''; position: absolute; top: 0; right: 0; width: 14px; height: 14px; background: linear-gradient(135deg, rgba(255,255,255,.12) 0%, rgba(255,255,255,0) 100%); }
.t2-file-block .file-icon::after { content: ''; position: absolute; top: 0; right: 0; width: 0; height: 0; border-style: solid; border-width: 7px; border-color: #fff #fff transparent transparent; }
.t2-file-block .file-info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.t2-file-block .file-name { font-size: 17px; font-weight: 500; color: rgba(0,0,0,.87); margin: 0 0 6px 0; letter-spacing: .15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }
.t2-file-block .file-details { color: rgba(0,0,0,.6); font-size: 12px; line-height: 1.5; letter-spacing: .25px; display: flex; gap: 12px; }
.t2-file-block .file-details span { display: inline-block; white-space: nowrap; }
.t2-file-block:hover .t2-media-controls { display: flex; }

.audio-file-container { width: 100%; min-width: 240px; max-width: 380px; aspect-ratio: 4/1; background: #fff; border-radius: 12px; border: 1px solid #cdcdcd; padding: 0 20px; display: flex; align-items: center; font-family: 'Roboto', Arial, sans-serif; transition: opacity 0.2s ease; box-sizing: border-box; padding-right: 12px; }
.audio-file-container:hover { opacity: .95; }
.audio-file-icon { width: 36px; height: 45px; background-color: #7C4DFF; border-radius: 6px; margin-right: 20px; position: relative; flex-shrink: 0; overflow: hidden; }
.audio-file-icon::before { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 20px; height: 20px; background: #fff; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3h-6z'/%3E%3C/svg%3E") center/contain no-repeat; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3h-6z'/%3E%3C/svg%3E") center/contain no-repeat; opacity: .9; }
.audio-file-icon::after { content: ''; position: absolute; top: 0; right: 0; width: 0; height: 0; border-style: solid; border-width: 7px; border-color: #fff #fff transparent transparent; }
.audio-file-info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.audio-file-name { font-size: 17px; font-weight: 500; color: rgba(0,0,0,.87); margin: 0 0 6px 0; letter-spacing: .15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }
.audio-file-details { color: rgba(0,0,0,.6); font-size: 12px; line-height: 1.5; letter-spacing: .25px; display: flex; gap: 12px; }
.audio-file-details span { display: inline-block; white-space: nowrap; }
.audio-duration { color: #7C4DFF; font-weight: 500; min-width: 45px; text-align: right; margin-left: auto; }
.audio-player { display: none; }

/* Dark Mode */
html[data-t2editor-theme="dark"] .t2-file-editor-modal { background-color: #2d2d2d; color: #e0e0e0; box-shadow: 0 4px 24px rgba(0,0,0,.3); border-color: #444; }
html[data-t2editor-theme="dark"] .t2-file-editor-modal h3 { color: #e0e0e0; }
html[data-t2editor-theme="dark"] .t2-file-upload-area { border-color: #444; color: #e0e0e0; }
html[data-t2editor-theme="dark"] .t2-file-upload-area:hover, html[data-t2editor-theme="dark"] .t2-file-upload-area.drag-over { border-color: #0187fe; background-color: rgba(1,135,254,.1); }
html[data-t2editor-theme="dark"] .t2-file-upload-area .material-icons { color: #aaa; }
html[data-t2editor-theme="dark"] .t2-file-upload-text { color: #e0e0e0; }
html[data-t2editor-theme="dark"] .t2-file-upload-hint { color: #aaa; }
html[data-t2editor-theme="dark"] .t2-file-preview-item { background-color: #383838; border-color: #444; }
html[data-t2editor-theme="dark"] .t2-file-preview-item:hover { background-color: #444; }
html[data-t2editor-theme="dark"] .t2-file-preview-remove { background-color: rgba(0,0,0,.6); }
html[data-t2editor-theme="dark"] .t2-file-preview-remove:hover { background-color: rgba(0,0,0,.8); }
html[data-t2editor-theme="dark"] .t2-file-preview-name { color: #e0e0e0; }
html[data-t2editor-theme="dark"] .file-container { background-color: #2d2d2d; border-color: #444; color: #e0e0e0; }
html[data-t2editor-theme="dark"] .t2-file-block .file-container:hover { background-color: #383838; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
html[data-t2editor-theme="dark"] .t2-file-block .file-name { color: rgba(255,255,255,.87); }
html[data-t2editor-theme="dark"] .t2-file-block .file-details { color: rgba(255,255,255,.6); }
html[data-t2editor-theme="dark"] .audio-file-container { background-color: #2d2d2d; border-color: #444; color: #e0e0e0; }