/* Complementary Files Display Plugin Styles */

.complementary-files-container {
    margin: 2rem 0;
    background: #ffffff;
}

/* Styles spécifiques pour les produits WooCommerce */
.complementary-files-product {
    /* Styles spécifiques aux produits si nécessaire */
}

.complementary-files-post {
    /* Styles spécifiques aux articles si nécessaire */
}

.complementary-files-title {
    margin: 0 0 1.5rem 0;
    font-size: 30px;
    font-family: "Outfit", sans-serif;
    font-weight: 600;
    color: #04559E;
    padding-bottom: 20px;
    position: relative;
}

.complementary-files-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 5px;
    background-color: #FFA006;
}

.complementary-files-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
    gap: 1rem;
}

.complementary-file-item {
    padding: 1.5rem;
    background: #F7F7F7;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.file-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.complementary-file-item:hover {
    border-color: #04559E;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.file-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: #04559E;
    color: white;
    border-radius: 6px;
    flex-shrink: 0;
}

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

.file-extension {
    position: absolute;
    bottom: -2px;
    right: -2px;
    font-size: 0.6rem;
    font-weight: bold;
    background: #e74c3c;
    color: white;
    padding: 1px 3px;
    border-radius: 2px;
    line-height: 1;
}

.file-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.file-link {
    text-decoration: none;
    color: #2c3e50;
    font-weight: 500;
    transition: color 0.3s ease;
}

.file-link:hover {
    color: #3498db;
    text-decoration: underline;
}

.file-name {
    font-size: 1rem;
    line-height: 1.4;
    margin: 0;
    font-weight: 600;
    color: #2c3e50;
}

.file-size {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: normal;
}

.file-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-download {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #EF821B;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.btn-download:hover {
    background: #FFA006;
    color: white;
    text-decoration: none;
}

.btn-download svg {
    width: 16px;
    height: 16px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.complementary-files-error {
    color: #e74c3c;
    background: #fdf2f2;
    border: 1px solid #fecaca;
    padding: 1rem;
    border-radius: 4px;
    margin: 1rem 0;
}

/* PDF Viewer Styles */
.pdf-viewer {
    margin-top: 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* PDF Iframe Styles */
.pdf-viewer.pdf-iframe {
    position: relative;
}

.pdf-iframe-embed {
    width: 100%;
    border: none;
    border-radius: 6px;
    background: #f5f5f5;
    display: block;
}

.pdf-iframe-embed p {
    padding: 2rem;
    text-align: center;
    color: #666;
    font-style: italic;
    margin: 0;
}

.pdf-iframe-embed p a {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}

.pdf-iframe-embed p a:hover {
    text-decoration: underline;
}

/* Animation de chargement pour les PDFs */
.pdf-viewer .loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    background: #f8f9fa;
    color: #6c757d;
    font-style: italic;
}

.pdf-viewer .loading:before {
    content: "Chargement du PDF...";
}

/* Responsive Design */
@media (max-width: 768px) {
    .complementary-files-title {
        font-size: 25px;
    }

    .complementary-files-container {
        margin: 1rem 0;
        padding: 1rem;
    }

    .file-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .complementary-file-item {
        padding: 1rem;
    }

    .pdf-viewer {
        margin-top: 0.75rem;
    }


    .pdf-iframe-embed {
        height: 400px !important;
    }

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

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

    .file-info {
        width: 100%;
    }

    .file-actions {
        align-self: flex-end;
    }
}

@media (max-width: 480px) {
    .complementary-files-title {
        font-size: 1.1rem;
    }

    .file-name {
        font-size: 0.9rem;
    }

    .file-size {
        font-size: 0.8rem;
    }

    .btn-download {
        width: 32px;
        height: 32px;
    }

    .btn-download svg {
        width: 14px;
        height: 14px;
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.complementary-file-item {
    animation: fadeInUp 0.3s ease forwards;
}

.complementary-file-item:nth-child(1) {
    animation-delay: 0.1s;
}

.complementary-file-item:nth-child(2) {
    animation-delay: 0.2s;
}

.complementary-file-item:nth-child(3) {
    animation-delay: 0.3s;
}

.complementary-file-item:nth-child(4) {
    animation-delay: 0.4s;
}

.complementary-file-item:nth-child(5) {
    animation-delay: 0.5s;
}