/* Variables CSS para fácil personalización */
:root {
    --ov-gdfd-primary-color: #4741d7;
    --ov-gdfd-primary-hover: #140e9f;
    --ov-gdfd-border-color: #e0e0e0;
    --ov-gdfd-hover-border: var(--ov-gdfd-primary-color);
    --ov-gdfd-background: #ffffff;
    --ov-gdfd-hover-background: #f8f9fa;
    --ov-gdfd-text-color: #333333;
    --ov-gdfd-text-secondary: #666666;
    --ov-gdfd-border-radius: 8px;
    --ov-gdfd-shadow: 0 2px 4px rgba(0,0,0,0.1);
    --ov-gdfd-shadow-hover: 0 4px 12px rgba(0,0,0,0.15);
}

/* Contenedor principal */
.ov-gdfd-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: inherit;
}

/* Estados de carga y error */
.ov-gdfd-loading {
    text-align: center;
    padding: 40px;
    color: var(--ov-gdfd-text-secondary);
    font-size: 16px;
}

.ov-gdfd-error {
    background-color: #fee;
    color: #c33;
    padding: 15px;
    border-radius: var(--ov-gdfd-border-radius);
    border: 1px solid #fcc;
    margin: 10px 0;
}

.ov-gdfd-no-files {
    text-align: center;
    padding: 40px;
    color: #999;
    font-style: italic;
}

/* Vista en cuadrícula */
.ov-gdfd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.ov-gdfd-grid-item {
    background: var(--ov-gdfd-background);
    border: 1px solid var(--ov-gdfd-border-color);
    border-radius: var(--ov-gdfd-border-radius);
    padding: 24px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: var(--ov-gdfd-shadow);
    position: relative;
    overflow: hidden;
}

.ov-gdfd-grid-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--ov-gdfd-primary-color), var(--ov-gdfd-primary-hover));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.ov-gdfd-grid-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--ov-gdfd-shadow-hover);
    border-color: var(--ov-gdfd-hover-border);
}

.ov-gdfd-grid-item:hover::before {
    transform: scaleX(1);
}

.ov-gdfd-grid-item .ov-gdfd-file-icon {
    margin-bottom: 16px;
}

.ov-gdfd-grid-item .ov-gdfd-file-name {
    font-weight: 600;
    color: var(--ov-gdfd-text-color);
    margin-bottom: 12px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.4;
}

.ov-gdfd-grid-item .ov-gdfd-file-size {
    color: var(--ov-gdfd-text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
    font-weight: 500;
}

/* Vista en lista */
.ov-gdfd-list {
    margin-top: 20px;
}

.ov-gdfd-list-item {
    background: var(--ov-gdfd-background);
    border: 1px solid var(--ov-gdfd-border-color);
    border-radius: var(--ov-gdfd-border-radius);
    padding: 20px 24px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.ov-gdfd-list-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--ov-gdfd-primary-color);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.ov-gdfd-list-item:hover {
    background-color: var(--ov-gdfd-hover-background);
    border-color: var(--ov-gdfd-hover-border);
    transform: translateX(4px);
}

.ov-gdfd-list-item:hover::before {
    transform: scaleY(1);
}

.ov-gdfd-list-item .ov-gdfd-file-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.ov-gdfd-list-item .ov-gdfd-file-icon {
    margin-right: 16px;
    flex-shrink: 0;
}

.ov-gdfd-list-item .ov-gdfd-file-name {
    font-weight: 500;
    color: var(--ov-gdfd-text-color);
}

.ov-gdfd-list-item .ov-gdfd-file-meta {
    display: flex;
    align-items: center;
    gap: 24px;
}

.ov-gdfd-list-item .ov-gdfd-file-size {
    color: var(--ov-gdfd-text-secondary);
    font-size: 14px;
    min-width: 80px;
    text-align: right;
    font-weight: 500;
}

/* Iconos SVG */
.ov-gdfd-file-icon {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ov-gdfd-list-item .ov-gdfd-file-icon {
    width: 32px;
    height: 32px;
}

.ov-gdfd-file-icon svg {
    width: 100%;
    height: 100%;
    fill: var(--ov-gdfd-primary-color);
    transition: fill 0.3s ease;
}

.ov-gdfd-grid-item:hover .ov-gdfd-file-icon svg,
.ov-gdfd-list-item:hover .ov-gdfd-file-icon svg {
    fill: var(--ov-gdfd-primary-hover);
}

/* Botones de descarga */
.ov-gdfd-download-btn {
    background: linear-gradient(135deg, var(--ov-gdfd-primary-color), var(--ov-gdfd-primary-hover));
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,123,186,0.2);
    position: relative;
    overflow: hidden;
}

.ov-gdfd-download-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.ov-gdfd-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,123,186,0.3);
    color: white;
    text-decoration: none;
}

.ov-gdfd-download-btn:hover::before {
    left: 100%;
}

.ov-gdfd-download-btn:active {
    transform: translateY(0);
}

/* Icono de descarga en el botón */
.ov-gdfd-download-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Responsive */
@media (max-width: 768px) {
    .ov-gdfd-container {
        padding: 16px;
    }
    
    .ov-gdfd-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
    }
    
    .ov-gdfd-grid-item {
        padding: 20px;
    }
    
    .ov-gdfd-list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px 20px;
    }
    
    .ov-gdfd-list-item .ov-gdfd-file-meta {
        width: 100%;
        justify-content: space-between;
    }
    
    .ov-gdfd-list-item .ov-gdfd-file-size {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .ov-gdfd-grid {
        grid-template-columns: 1fr;
    }
    
    .ov-gdfd-grid-item .ov-gdfd-file-icon {
        width: 40px;
        height: 40px;
    }
    
    .ov-gdfd-list-item .ov-gdfd-file-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .ov-gdfd-list-item .ov-gdfd-file-icon {
        margin-right: 0;
    }
    
    .ov-gdfd-download-btn {
        padding: 10px 20px;
        font-size: 13px;
    }
}

/* Animaciones */
@keyframes fadeInUp {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.ov-gdfd-file-item {
    animation: fadeInUp 0.4s ease forwards;
}

.ov-gdfd-file-item:nth-child(1) { animation-delay: 0.1s; }
.ov-gdfd-file-item:nth-child(2) { animation-delay: 0.15s; }
.ov-gdfd-file-item:nth-child(3) { animation-delay: 0.2s; }
.ov-gdfd-file-item:nth-child(4) { animation-delay: 0.25s; }
.ov-gdfd-file-item:nth-child(5) { animation-delay: 0.3s; }
.ov-gdfd-file-item:nth-child(6) { animation-delay: 0.35s; }

/* Estilos para Divi */
.et_pb_module .ov-gdfd-container {
    font-family: inherit;
}

.et_pb_module .ov-gdfd-download-btn {
    font-family: inherit;
}