.library-intro-box {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.library-intro-box h1 {
    font-size: 2rem;
    color: #1565c0;
    margin-bottom: 1rem;
}
.library-intro-box p {
    font-size: 1.1rem;
    color: #555;
    max-width: 800px;
    margin: 0 auto;
}

.library-content .icon {
    font-size: 5rem;
    color: #1565c0;
    margin-bottom: 2rem;
    animation: float 3s ease-in-out infinite;
}

.contribution-box {
    padding: 2rem;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #ddd;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}
.contribution-box h2 {
    color: #1565c0;
    font-size: 1.8rem;
    margin-bottom: 1rem;
}
.contribution-box p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.contribution-box h3 {
    font-size: 1.2rem;
    color: #333;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.contribution-box ol {
    padding-left: 2rem; /* Add indentation to the list */
    margin-bottom: 1.5rem;
}
.contribution-box ol li {
    margin-bottom: 0.75rem; /* Add space between list items */
}

.contribution-box .cta-button.secondary {
    background: transparent;
    border: 2px solid #1565c0;
    color: #1565c0;
}
.contribution-box .cta-button.secondary:hover {
    background: #e3f2fd; /* Light blue background on hover */
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

/* Library Browser Section */
.library-browser-section {
    padding: 2rem;
    background: #fff;
}

.library-browser {
    max-width: 1000px;
    margin: 0 auto;
}

/* Library Search Box */
.library-search-box {
    position: relative;
    margin-bottom: 2rem;
}

.library-search-box input {
    width: 100%;
    padding: 1rem 3.5rem; /* Add padding for the icon and clear button */
    font-size: 1.1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.library-search-box input:focus {
    outline: none;
    border-color: #1565c0;
    box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.2);
}
.library-search-box .fa-magnifying-glass {
    position: absolute; left: 1.25rem; top: 50%; transform: translateY(-50%); color: #999; font-size: 1.2rem;
}
.library-search-box .clear-btn {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.8rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.library-search-box .clear-btn:hover {
    color: #333;
}

/* Hide the default 'x' from search inputs in WebKit browsers */
.library-search-box input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

.no-results-message {
    text-align: center;
    padding: 2rem;
    font-size: 1.2rem;
    color: #777;
    background: #f9f9f9;
    border-radius: 8px;
}

.library-category {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.library-category summary {
    padding: 1.5rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: #1565c0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
}

.library-category summary:hover {
    background-color: #f1f1f1;
}

.library-category summary::after {
    content: '\f078'; /* Font Awesome chevron-down */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    transition: transform 0.3s ease;
}

.library-category[open] > summary::after {
    transform: rotate(180deg);
}

.library-category-content {
    padding: 0 1.5rem 1.5rem;
}

.library-folder {
    margin-left: 1rem;
    border-left: 2px solid #e0e0e0;
    padding-left: 1rem;
    margin-top: 1rem;
}

.library-folder summary {
    padding: 0.75rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.library-folder summary::after {
    font-size: 0.9rem;
}

.library-file {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid #eee;
    gap: 1rem;
}

.library-file:last-child {
    border-bottom: none;
}

.file-name {
    flex-grow: 1;
    font-size: 1.1rem;
    color: #333;
}

.file-name h3 {
    font-size: inherit; /* Inherit font-size from .file-name */
    font-weight: normal; /* Reset bold from h3 */
    margin: 0; /* Reset default margin from h3 */
}

.file-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.file-actions a, .file-actions button {
    color: #555;
    font-size: 1.2rem;
    text-decoration: none;
    transition: color 0.2s, transform 0.2s;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
}

.file-actions a:hover, .file-actions button:hover {
    color: #1565c0;
    transform: scale(1.1);
}

/* Style for highlighting a file from a direct link */
.library-file.highlight {
    
    position: relative; 
    /* Animate from a strong color to a subtle permanent background */
    animation: highlight-to-permanent 2.5s ease-out forwards;
}

@keyframes highlight-to-permanent {
    0% { background-color: #fff4c2; } /* Strong yellow start */
    30% { background-color: #fff4c2; }
    100% { background-color: #eef6ff; } /* Subtle light blue end state */
}



a.import-button {
    background: #28a745; /* Green CTA */
    color: white !important;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem !important;
    font-weight: bold;
    white-space: nowrap;
    transition: background-color 0.2s, transform 0.2s;
}

a.import-button:hover {
    background: #218838; /* Darker green on hover */
    color: white !important;
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
}
.toast-notification.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -10px);
}

/* Share Modal Styles */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.share-modal {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 500px;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal-backdrop.show .share-modal {
    transform: translateY(0);
}

.share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.share-modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: #333;
    word-break: break-word;
}

.share-modal-header .close-btn {
    background: none; border: none; font-size: 2rem; color: #999; cursor: pointer; line-height: 1;
}

.share-link-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.share-link-container input {
    flex-grow: 1;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
    background: #f4f4f4;
}

.share-socials {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.share-socials .cta-button {
    width: 50px;
    height: 50px;
    padding: 0;
    margin: 0;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
}

.share-socials .cta-button i {
    margin-right: 0; /* Override margin from common.css */
}



@media (max-width: 768px) {
    .library-file {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding-left: 0; /* Remove horizontal padding from the file container */
        padding-right: 0;
    }
    .file-name {
        font-size: 1rem;
        margin-bottom: 0.5rem;
        padding: 0 1rem; /* Add padding to inner elements instead */
        width: 100%;
    }
    .file-actions {
        width: 100%;
        justify-content: space-between;
        padding: 0 1rem; /* Add padding to inner elements instead */
    }
    .library-category-content {
        padding: 0 0 1.5rem; /* Remove horizontal padding */
    }
    .import-button {
        flex-grow: 1;
        text-align: center;
    }
    .library-browser-section {
        padding: 2rem 0.8rem; /* Reduce horizontal padding on mobile */
    }
    .library-folder {
        margin-left: 0.8rem;
        padding-left: 0.8rem;
    }
    .contribution-section .library-browser {
        padding: 0 0.8rem 2rem;
    }
    .share-modal {
        width: 95%;
        padding: 1.2rem 1rem;
    }
    .share-modal-header {
        padding-bottom: 0.8rem;
        margin-bottom: 1rem;
    }
}

/* Contribution Section at the bottom */
.contribution-section {
    /* Padding is now handled by the .library-browser inside this section */
    padding-bottom: 2rem;
}
