/* 
 * DBF Files - Public Styles (3D Depth Design)
 * Modern depth-based styling with layered shadows
 */

:root {
    --depth-0: rgba(0, 0, 0, 0.04);
    --depth-1: rgba(0, 0, 0, 0.06);
    --depth-2: rgba(0, 0, 0, 0.09);
    --depth-3: rgba(0, 0, 0, 0.12);
    --depth-4: rgba(0, 0, 0, 0.15);
    
    --shadow-depth-1: 0 1px 3px var(--depth-0), 0 1px 2px var(--depth-1);
    --shadow-depth-2: 0 2px 6px var(--depth-1), 0 2px 4px var(--depth-2);
    --shadow-depth-3: 0 4px 12px var(--depth-2), 0 4px 8px var(--depth-3);
    --shadow-depth-4: 0 8px 24px var(--depth-3), 0 8px 16px var(--depth-4);
    
    /* Slate color palette - Light shades */
    --color-button: #64748B;
    --color-button-dark: #475569;
    
    /* File type tag colors */
    --tag-pdf: #94A3B8;
    --tag-image: #78716C;
    --tag-document: #71717A;
    --tag-spreadsheet: #6B7280;
    --tag-text: #64748B;
    --tag-archive: #57534E;
}

* {
    box-sizing: border-box;
}

/* ========================================
   CATEGORY FILES CONTAINER
   ======================================== */

.dbf-category-files {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 40px 0;
}

.dbf-category-header {
    margin-bottom: 40px;
}

.dbf-category-header h2 {
    margin: 0 0 12px 0;
    font-size: 32px;
    font-weight: 700;
    color: #1F2937;
    letter-spacing: -0.5px;
}

.dbf-category-header p {
    margin: 0;
    font-size: 16px;
    color: #6B7280;
    line-height: 1.6;
}

/* ========================================
   FILE GRID - 3D DEPTH DESIGN
   ======================================== */

.dbf-files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 28px;
    margin-top: 30px;
}

.dbf-file-card {
    position: relative;
    background: #FFFFFF;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-depth-2);
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Depth Layer 1 - Base */
.dbf-file-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.02) 0%, rgba(79, 70, 229, 0) 100%);
    pointer-events: none;
}

.dbf-file-card:hover {
    box-shadow: var(--shadow-depth-4);
}

/* ========================================
   FILE PREVIEW AREA (BACKGROUND)
   ======================================== */

.dbf-file-preview {
    position: relative;
    width: 100%;
    height: 120px;
    background: linear-gradient(135deg, #F3F4F6 0%, #E5E7EB 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    flex-shrink: 0;
    border-bottom: 1px solid #E5E7EB;
    overflow: hidden;
}

/* Excel preview expande el contenedor */
.dbf-file-preview.dbf-excel-preview {
    height: auto;
    min-height: 120px;
    background: transparent;
    padding: 0;
    overflow: visible;
}

/* Background preview image (subtle) */
.dbf-file-preview[data-preview-url]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: top center;
    background-repeat: no-repeat;
    background-image: var(--preview-image, none);
    opacity: 0.75;
    filter: blur(0) brightness(1);
    z-index: 0;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* On hover: imagen nítida y sin blur */
.dbf-file-card:hover .dbf-file-preview[data-preview-url]::before {
    opacity: 1;
    filter: blur(0) brightness(1);
}

/* ========================================
   FILE TAG (COLOR BY TYPE)
   ======================================== */

.dbf-file-tag-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.dbf-file-tag {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Type-specific colors */
.dbf-file-tag.pdf { background: var(--tag-pdf); }
.dbf-file-tag.image { background: var(--tag-image); }
.dbf-file-tag.document { background: var(--tag-document); }
.dbf-file-tag.spreadsheet { background: var(--tag-spreadsheet); }
.dbf-file-tag.text { background: var(--tag-text); }
.dbf-file-tag.archive { background: var(--tag-archive); }

.dbf-file-extension {
    margin: 0;
    font-size: 11px;
    font-weight: 700;
    color: #9CA3AF;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ========================================
   FILE ICON (LEGACY - REMOVED)
   ======================================== */

.dbf-file-icon-wrapper {
    display: none;
}

.dbf-file-icon {
    display: none;
}

/* ========================================
   FILE HEADER LAYOUT
   ======================================== */

.dbf-file-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

/* ========================================
   SKELETON LOADER (PDF PREVIEW)
   ======================================== */

.dbf-file-preview.dbf-pdf-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        #E5E7EB 0%,
        #F3F4F6 20%,
        #E5E7EB 40%
    );
    background-size: 200% 100%;
    animation: dbf-skeleton-loading 1.5s infinite;
    z-index: 2;
    border-radius: 4px;
}

@keyframes dbf-skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* SVG oculto durante carga */
.dbf-file-preview.dbf-pdf-loading svg {
    opacity: 0;
}

/* ========================================
   EXCEL PREVIEW
   ======================================== */

.dbf-file-preview.dbf-excel-preview {
    height: 148px;
    min-height: 148px;
    background: transparent;
    padding: 0;
    overflow: hidden;
}

.dbf-excel-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    background: white;
    border: none;
    border-radius: 0;
    max-height: 100%;
    overflow: hidden;
}

.dbf-excel-header {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    padding: 2px 8px;
    color: white;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 18px;
    line-height: 1;
}

.dbf-sheet-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dbf-sheet-count {
    font-size: 7px;
    opacity: 0.9;
    margin-left: 4px;
    flex-shrink: 0;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.3), 
                 inset -2px -2px 4px rgba(0, 0, 0, 0.2),
                 inset 1px 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(1px);
}

.dbf-excel-table {
    flex: 1;
    overflow: hidden;
}

.dbf-excel-scroll {
    display: none;
}

.dbf-excel-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 8px;
    background: white;
}

.dbf-excel-table thead {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
    position: sticky;
    top: 0;
}

.dbf-excel-table th {
    padding: 3px 5px;
    text-align: left;
    font-weight: 600;
    color: #059669;
    border-right: 1px solid #E5E7EB;
    border-bottom: 2px solid #10B981;
    white-space: nowrap;
    font-size: 8px;
}

.dbf-excel-table td {
    padding: 3px 5px;
    border-right: 1px solid #F3F4F6;
    border-bottom: 1px solid #F3F4F6;
    color: #4B5563;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 50px;
}

.dbf-excel-table tbody tr:hover {
    background: #F9FAFB;
}

.dbf-excel-table tbody tr:nth-child(even) {
    background: #FAFBFC;
}

.dbf-excel-preview.dbf-excel-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
    animation: dbf-excel-shimmer 1.5s infinite;
    z-index: 10;
}

@keyframes dbf-excel-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.dbf-excel-error {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #F3F4F6 0%, #E5E7EB 100%);
    color: #9CA3AF;
    font-size: 12px;
    text-align: center;
    padding: 20px;
}

/* ========================================
   DOCUMENT PREVIEW (DOCX, DOC, ODT, RTF)
   ======================================== */

.dbf-file-preview.dbf-doc-preview {
    height: 148px;
    min-height: 148px;
    background: transparent;
    padding: 0;
    overflow: hidden;
}

.dbf-doc-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: white;
    border: none;
    max-height: 100%;
    overflow: hidden;
}

.dbf-doc-content {
    flex: 1;
    padding: 12px;
    font-size: 11px;
    line-height: 1.5;
    color: #4B5563;
    background: white;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Segoe UI', Roboto, sans-serif;
}

.dbf-doc-placeholder {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #F3F4F6 0%, #E5E7EB 100%);
    color: #9CA3AF;
    font-size: 13px;
    text-align: center;
    padding: 20px;
    font-weight: 500;
}

.dbf-doc-error {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #F3F4F6 0%, #E5E7EB 100%);
    color: #9CA3AF;
    font-size: 12px;
    text-align: center;
    padding: 20px;
}

.dbf-file-preview.dbf-doc-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
    animation: dbf-doc-shimmer 1.5s infinite;
    z-index: 10;
}

@keyframes dbf-doc-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ========================================
   TEXT PLAIN FILES PREVIEW (TXT, JSON, XML, CSV, SQL)
   ======================================== */

.dbf-file-preview.dbf-text-preview {
    height: 148px;
    min-height: 148px;
    background: transparent;
    padding: 0;
    overflow: hidden;
}

.dbf-text-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: white;
    border: none;
    max-height: 100%;
    overflow: hidden;
}

.dbf-text-content {
    flex: 1;
    padding: 12px;
    font-size: 10px;
    line-height: 1.4;
    color: #2D3748;
    background: #FAFBFC;
    overflow: hidden;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
    border: none;
}

.dbf-text-content.dbf-text-formatted {
    background: #F7FAFC;
    color: #1A202C;
}

.dbf-text-content.dbf-text-json::before {
    content: '{ }';
    display: block;
    color: #718096;
    font-size: 9px;
    margin-bottom: 2px;
}

.dbf-text-content.dbf-text-xml::before {
    content: '< >';
    display: block;
    color: #718096;
    font-size: 9px;
    margin-bottom: 2px;
}

.dbf-text-content.dbf-text-csv {
    color: #276749;
}

.dbf-text-content.dbf-text-sql {
    color: #2D3748;
}

.dbf-text-placeholder {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #F3F4F6 0%, #E5E7EB 100%);
    color: #9CA3AF;
    font-size: 13px;
    text-align: center;
    padding: 20px;
    font-weight: 500;
}

.dbf-file-preview.dbf-text-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
    animation: dbf-text-shimmer 1.5s infinite;
    z-index: 10;
}

@keyframes dbf-text-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ========================================
   ARCHIVE PREVIEW (ZIP, RAR, 7Z, TAR)
   ======================================== */

.dbf-file-preview.dbf-archive-preview {
    background: white;
    display: flex;
    flex-direction: column;
}

.dbf-archive-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 12px;
    background: white;
    overflow: hidden;
}

.dbf-archive-header {
    font-size: 11px;
    font-weight: 600;
    color: #1F2937;
    padding: 8px 0;
    border-bottom: 1px solid #E5E7EB;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dbf-archive-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    max-height: 100%;
    font-size: 11px;
}

.dbf-archive-list li {
    padding: 4px 0;
    color: #374151;
    border-bottom: 1px solid #F3F4F6;
    word-break: break-all;
    font-family: 'Courier New', monospace;
}

.dbf-archive-list li:last-child {
    border-bottom: none;
}

.dbf-archive-list li.dbf-archive-more {
    color: #9CA3AF;
    font-style: italic;
    padding: 8px 0;
}

.dbf-archive-placeholder {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #F3F4F6 0%, #E5E7EB 100%);
    color: #9CA3AF;
    font-size: 13px;
    text-align: center;
    padding: 20px;
    font-weight: 500;
}

.dbf-file-preview.dbf-archive-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
    animation: dbf-archive-shimmer 1.5s infinite;
    z-index: 10;
}

@keyframes dbf-archive-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ========================================
   GENERIC FILE TYPE BACKGROUND
   ======================================== */

.dbf-file-preview.dbf-generic-bg::after {
    content: attr(data-file-type-bg);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(229, 231, 235, 0.5) 0%, rgba(243, 244, 246, 0.5) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: 200;
    color: rgba(209, 213, 219, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 1;
    pointer-events: none;
}

/* ========================================
   FALLBACK VISUAL (PDF NO CARGÓ)
   ======================================== */

.dbf-file-preview.dbf-pdf-failed::after {
    content: attr(data-file-type);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #F3F4F6 0%, #E5E7EB 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 300;
    color: #D1D5DB;
    text-transform: uppercase;
    letter-spacing: 2px;
    z-index: 2;
}

.dbf-file-icon.dbf-pdf-failed svg {
    opacity: 0.3;
}

/* Hacer clickeable el área de preview */
.dbf-file-preview[data-preview-url] {
    cursor: pointer;
}

/* ========================================
   FILE CONTENT
   ======================================== */

.dbf-file-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.dbf-file-info {
    flex: 1;
}

.dbf-file-name {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    word-break: break-word;
    line-height: 1.3;
}

.dbf-file-size {
    margin: 0 0 8px 0;
    font-size: 12px;
    color: #9CA3AF;
    font-weight: 500;
}

.dbf-file-description {
    margin: 0;
    font-size: 13px;
    color: #6B7280;
    line-height: 1.4;
    max-height: 40px;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

/* ========================================
   FILE ACTIONS (BUTTONS)
   ======================================== */

.dbf-file-actions {
    display: flex;
    gap: 0;
    margin-top: 10px;
    padding: 0;
    border-top: 1px solid #E2E8F0;
    width: 100%;
    flex-wrap: nowrap;
    justify-content: stretch;
}

.dbf-btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border-radius: 0;
    transition: all 0.2s ease;
    border: none;
    border-right: 1px solid #E2E8F0;
    cursor: pointer;
    letter-spacing: 0.3px;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #64748B;
}

.dbf-btn:last-child {
    border-right: none;
}

.dbf-btn:hover {
    box-shadow: none;
    transform: none;
    background: #F1F5F9;
    color: #475569;
}

.dbf-btn:active {
    transform: none;
    box-shadow: none;
    background: #E2E8F0;
}

/* Ver Button */
.dbf-btn-view {
    background: transparent;
    color: #64748B;
}

.dbf-btn-view:hover {
    background: #F1F5F9;
    color: #475569;
}

/* Descargar Button */
.dbf-btn-download {
    background: transparent;
    color: #64748B;
}

.dbf-btn-download:hover {
    background: #F1F5F9;
    color: #475569;
}

.dbf-btn-text {
    display: inline;
    white-space: nowrap;
}

.dbf-btn-icon {
    display: none;
}

/* ========================================
   NO FILES STATE
   ======================================== */

.dbf-no-files {
    padding: 40px 20px;
    background: linear-gradient(135deg, #F9FAFB 0%, #F3F4F6 100%);
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow-depth-1);
}

.dbf-no-files p {
    margin: 0;
    font-size: 16px;
    color: #6B7280;
}

.dbf-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 28px;
    margin-top: 30px;
}

.dbf-category-card {
    position: relative;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-depth-2);
    display: flex;
    flex-direction: column;
}

.dbf-category-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-depth-4);
}

.dbf-category-card-header {
    padding: 24px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    color: white;
}

.dbf-category-card-header h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 700;
    word-break: break-word;
}

.dbf-category-card-header p {
    margin: 0;
    font-size: 14px;
    opacity: 0.95;
    line-height: 1.5;
}

.dbf-category-card-footer {
    padding: 16px 24px;
    background: #F9FAFB;
    border-top: 1px solid #E5E7EB;
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    font-size: 13px;
    color: #6B7280;
    font-weight: 500;
}

/* Shortcode Box - Container for layout selector and shortcode */
.dbf-shortcode-box {
    width: 100%;
    background: white;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dbf-shortcode-header {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 12px;
    color: #6B7280;
}

.dbf-shortcode-header small {
    font-weight: 600;
    white-space: nowrap;
}

.dbf-layout-select-sm {
    padding: 6px 10px;
    border: 1px solid #D1D5DB;
    border-radius: 4px;
    font-size: 12px;
    background-color: #FFFFFF;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    max-width: 180px;
}

.dbf-layout-select-sm:hover {
    border-color: #9CA3AF;
}

.dbf-layout-select-sm:focus {
    outline: none;
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.dbf-shortcode-display {
    display: flex;
    gap: 8px;
    align-items: center;
    background: #F3F4F6;
    border-radius: 4px;
    padding: 8px;
}

.dbf-shortcode-small {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    padding: 6px 8px;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 3px;
    word-break: break-all;
    color: #1F2937;
    display: block;
}

.dbf-shortcode-copy-btn-sm {
    padding: 6px 12px;
    background-color: #3B82F6;
    color: white;
    border: 1px solid #3B82F6;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.dbf-shortcode-copy-btn-sm:hover {
    background-color: #2563EB;
    border-color: #2563EB;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .dbf-files-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }

    .dbf-file-card {
        margin: 0;
    }

    .dbf-file-icon {
        width: 40px;
        height: 40px;
    }

    .dbf-file-icon svg {
        width: 40px;
        height: 40px;
    }

    .dbf-file-content {
        padding: 16px;
    }

    .dbf-file-name {
        font-size: 14px;
    }

    .dbf-file-actions {
        gap: 8px;
    }

    .dbf-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .dbf-categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
    }

    .dbf-category-header h2 {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .dbf-files-grid {
        grid-template-columns: 1fr;
    }

    .dbf-categories-grid {
        grid-template-columns: 1fr;
    }

    .dbf-category-header h2 {
        font-size: 20px;
    }

    .dbf-file-actions {
        flex-direction: column;
    }
    
    .dbf-file-actions .dbf-btn-view,
    .dbf-file-actions .dbf-btn-download {
        width: 100%;
    }
}

/* ========================================
   PROTECTED BADGE & UTILITIES
   ======================================== */

.dbf-protected-badge {
    margin-top: 10px;
    padding: 5px 8px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 4px;
    font-size: 11px;
    color: #92400e;
    text-align: center;
}

.dbf-empty-state {
    padding: 20px;
    background: #f5f5f5;
    border-radius: 4px;
    text-align: center;
    color: #999;
}

/* ========================================
   LAYOUT VARIANTS - COMPACT & ULTRACOMPACT
   ======================================== */

/* LAYOUT COMPACTO - Con preview pero más pequeño */
.dbf-layout-compact .dbf-files-grid {
    grid-template-columns: 1fr;
    gap: 12px;
}

.dbf-layout-compact .dbf-file-card {
    flex-direction: row;
    gap: 12px;
    padding: 12px;
    min-height: auto;
    align-items: flex-start;
    height: auto;
}

.dbf-layout-compact .dbf-file-preview {
    width: 150px;
    height: auto;
    min-height: 120px;
    max-height: 150px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    object-fit: cover;
}

.dbf-layout-compact .dbf-file-content {
    flex: 1;
    gap: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.dbf-layout-compact .dbf-file-header {
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}

.dbf-layout-compact .dbf-file-name {
    font-size: 14px;
    margin: 0;
    word-break: break-word;
}

.dbf-layout-compact .dbf-file-size {
    font-size: 11px;
    color: #9CA3AF;
    margin: 0;
}

.dbf-layout-compact .dbf-file-description {
    display: none;
}

.dbf-layout-compact .dbf-file-tag-wrapper {
    display: none;
}

.dbf-layout-compact .dbf-file-actions {
    gap: 6px;
    padding: 0;
    flex-wrap: wrap;
    margin-top: auto;
}

.dbf-layout-compact .dbf-btn {
    padding: 6px 12px;
    font-size: 11px;
    flex: 0;
    background: var(--color-button);
    color: white;
    border: none;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.dbf-layout-compact .dbf-btn:hover {
    background: var(--color-button-dark);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.dbf-layout-compact .dbf-btn-text {
    display: inline;
}

.dbf-layout-compact .dbf-btn-icon {
    display: none;
}

/* LAYOUT ULTRACOMPACTO - Compacto en grid, múltiples por fila */
.dbf-layout-ultracompact .dbf-files-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}

.dbf-layout-ultracompact .dbf-file-card {
    flex-direction: column;
    gap: 0;
    padding: 0;
    min-height: auto;
    border: 1px solid #CBD5E1;
    background: white;
    border-radius: 6px;
    box-shadow: none;
    transition: all 0.2s ease;
    overflow: hidden;
    display: flex;
}

.dbf-layout-ultracompact .dbf-file-card:hover {
    box-shadow: var(--shadow-depth-2);
    transform: none;
    border-color: #94A3B8;
}

.dbf-layout-ultracompact .dbf-file-preview {
    display: none;
}

.dbf-layout-ultracompact .dbf-file-content {
    flex: 1;
    padding: 10px 8px;
    gap: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border-bottom: 1px solid #E2E8F0;
}

.dbf-layout-ultracompact .dbf-file-header {
    width: 100%;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0;
    margin-bottom: 0;
}

.dbf-layout-ultracompact .dbf-file-info {
    width: 100%;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dbf-layout-ultracompact .dbf-file-name {
    font-size: 11px;
    margin: 0;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
    word-break: break-word;
    color: #1F2937;
    font-weight: 600;
}

.dbf-layout-ultracompact .dbf-file-size {
    display: none;
}

.dbf-layout-ultracompact .dbf-file-description {
    display: none;
}

.dbf-layout-ultracompact .dbf-file-tag-wrapper {
    order: -1;
    margin-bottom: 8px;
}

.dbf-layout-ultracompact .dbf-file-tag {
    width: 36px;
    height: 36px;
    font-size: 10px;
}

.dbf-layout-ultracompact .dbf-file-actions {
    gap: 0;
    padding: 0;
    width: 100%;
    flex-wrap: nowrap;
    justify-content: stretch;
    margin-top: 0;
    display: flex;
    border-top: 1px solid #E2E8F0;
}

.dbf-layout-ultracompact .dbf-btn {
    flex: 1;
    padding: 6px 4px;
    font-size: 10px;
    white-space: nowrap;
    border-radius: 0;
    min-width: auto;
    background: transparent;
    color: #64748B;
    border: none;
    border-right: 1px solid #E2E8F0;
    box-shadow: none;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}

.dbf-layout-ultracompact .dbf-btn:last-child {
    border-right: none;
}

.dbf-layout-ultracompact .dbf-btn:hover {
    background: #F1F5F9;
    color: #475569;
    box-shadow: none;
}

.dbf-layout-ultracompact .dbf-btn:active {
    background: #E2E8F0;
}

.dbf-layout-ultracompact .dbf-btn-text {
    display: none;
}

.dbf-layout-ultracompact .dbf-btn-icon {
    display: inline;
    font-size: 14px;
}

.dbf-layout-ultracompact .dbf-category-header {
    display: none;
}

/* ========================================
   SHORTCODE SELECTOR - LAYOUT VARIANTS
   ======================================== */

.dbf-shortcode-selector {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dbf-layout-selector {
    display: flex;
    gap: 10px;
    align-items: center;
}

.dbf-layout-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 13px;
    cursor: pointer;
    min-width: 250px;
    transition: border-color 0.2s;
}

.dbf-layout-select:hover {
    border-color: #999;
}

.dbf-layout-select:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

/* Selector pequeño en tarjetas */
/* Shortcode selector - OLD STYLES (DEPRECATED - USE .dbf-shortcode-box instead) */
.dbf-shortcode-selector-sm {
    display: none; /* Hidden - use .dbf-shortcode-box instead */
}

.dbf-shortcode-copy-btn-sm {
    padding: 6px 10px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.dbf-shortcode-copy-btn-sm:hover {
    background: #e0e0e0;
    border-color: #999;
}
