/* Reset CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Import Inter font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    font-size: 16px;
}

/* Header */
header {
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 1.2rem 0;
    margin-bottom: 1.5rem;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.header-logo {
    height: 32px;
    width: auto;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Folder */
.folder {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    margin-bottom: 3rem;
    overflow: hidden;
    border: none;
}

.folder-name {
    color: #0074e4;
    padding: 1rem;
    font-size: 1.2rem;
    border-bottom: 2px solid #0074e4;
    font-weight: 600;
    background-color: transparent;
}

.folder-content {
    padding: 1.5rem;
    line-height: 1.7;
    color: #495057;
    font-size: 16px;
    font-weight: 400;
}

/* Files */
.files {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.2rem;
    margin-top: 0.5rem;
}

.file-card {
    background-color: #ffffff;
    border-radius: 8px;
    border: none;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    padding: 10px;
}

/* .file-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 116, 228, 0.15);
} */

.file-link {
    display: block;
    padding: 1rem;
    color: #495057;
    text-decoration: none;
}

.file-link:hover {
    color: #0074e4;
}

.file-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #0074e4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.file-name::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 8px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='16' height='16'%3E%3Cpath fill='%23e74c3c' d='M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-9.5 8.5h-3v-1h3v1zm3 3h-6v-1h6v1zm6-3h-6v-1h6v1z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

/* Stile per il link del titolo */
.file-name-link {
    color: #0074e4;
    text-decoration: none;
    font-weight: 600;
}

.file-name-link:hover {
    text-decoration: underline;
}

/* Stile per il pulsante copy link */
.copy-link-btn {
    background: none !important;
    border: none !important;
    color: #9ca3af !important;
    cursor: pointer !important;
    padding: 4px !important;
    border-radius: 4px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    opacity: 0.7 !important;
    flex-shrink: 0 !important;
    margin-left: 12px !important;
}

.copy-link-btn:hover {
    color: #0074e4 !important;
    background-color: #f1f5f9 !important;
    opacity: 1 !important;
    transform: scale(1.05) !important;
}

.copy-link-btn:active {
    transform: scale(0.95) !important;
}

.copy-link-btn svg {
    width: 12px !important;
    height: 12px !important;
}

/* Animazione per il feedback di copia */
.copy-link-btn.copied {
    color: #28a745 !important;
    background-color: #ecfdf5 !important;
    animation: copySuccess 0.3s ease !important;
}

@keyframes copySuccess {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

/* Stile per il link alla versione italiana */
.italian-version {
    margin-top: 0.8rem;
    text-align: right;
}

.italian-link {
    color: #0074e4;
    font-size: 0.85rem;
    text-decoration: none;
}

.italian-link:hover {
    text-decoration: underline;
}

.file-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #6c757d;
}

/* Footer */
footer {
    text-align: center;
    padding: 1rem;
    margin-top: 4rem;
    color: #6c757d;
    font-size: 0.85rem;
    border-top: 1px solid #dee2e6;
    background-color: transparent;
}

/* Loading */
.loading {
    text-align: center;
    padding: 2rem;
    font-style: italic;
    color: #6c757d;
    background-color: transparent;
    margin: 2rem 0;
}

/* Error */
.error {
    background-color: #f8d7da;
    border-left: 4px solid #dc3545;
    padding: 1rem;
    margin-bottom: 1rem;
    color: #721c24;
    border-radius: 0 4px 4px 0;
}

/* No Documents */
.no-documents {
    background-color: #e9ecef;
    border-left: 4px solid #6c757d;
    padding: 1rem;
    margin-bottom: 1rem;
    color: #495057;
    border-radius: 0 4px 4px 0;
    text-align: center;
}

.no-documents p {
    margin-bottom: 1rem;
    font-weight: 500;
}

/* Pulsante di ricarica */
.reload-button {
    background-color: #0074e4;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    margin-top: 0.8rem;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
}

.reload-button:hover {
    background-color: #0056b3;
}

.reload-button:active {
    background-color: #004494;
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #28a745;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.hide {
    opacity: 0;
    transform: translateY(20px);
}

/* Responsive */
@media (max-width: 768px) {
    .files {
        grid-template-columns: 1fr;
    }

    .toast {
        bottom: 10px;
        right: 10px;
        left: 10px;
        text-align: center;
    }

    .container {
        padding: 0 0.8rem;
    }

    .folder {
        margin-bottom: 1.5rem;
    }

    .folder-name {
        font-size: 1.1rem;
    }
}

/* Stili per il pulsante refresh */
.refresh-button {
    background: none;
    border: 1px solid #e2e8f0;
    color: #64748b;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    background-color: #f8fafc;
}

.refresh-button:hover {
    color: #0074e4;
    border-color: #0074e4;
    background-color: #f1f5f9;
    transform: translateY(-1px);
}

.refresh-button:active {
    transform: translateY(0);
}

.refresh-button svg {
    width: 16px;
    height: 16px;
}

/* Responsive per il pulsante refresh */
@media (max-width: 768px) {
    .refresh-button {
        font-size: 12px;
        padding: 6px 10px;
    }

    .refresh-button svg {
        width: 14px;
        height: 14px;
    }
}