/* Downloads Manager Frontend Styles */

.downloads-list {
    display: grid;
    gap: 20px;
    margin: 20px 0;
}

.download-item {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    gap: 15px;
}

.download-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.download-thumbnail {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    overflow: hidden;
    border-radius: 4px;
}

.download-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.download-content {
    flex: 1;
}

.download-title {
    margin: 0 0 10px 0;
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
}

.download-title a {
    color: #007cba;
    text-decoration: none;
    transition: color 0.2s ease;
}

.download-title a:hover {
    color: #005a87;
    text-decoration: underline;
}

.download-categories {
    margin-bottom: 10px;
}

.download-category {
    display: inline-block;
    background: #f0f0f0;
    color: #666;
    padding: 3px 8px;
    margin-right: 5px;
    border-radius: 12px;
    font-size: 0.8em;
    text-decoration: none;
}

.download-excerpt {
    margin-bottom: 15px;
    color: #666;
    line-height: 1.5;
}

.download-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.9em;
    color: #777;
}

.download-meta span {
    display: flex;
    align-items: center;
}

.download-meta span:before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 4px;
    background: #ccc;
    border-radius: 50%;
    margin-right: 8px;
}

.download-meta span:first-child:before {
    display: none;
}

.file-type {
    background: #e3f2fd;
    color: #1976d2;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 500;
}

.file-type:before {
    display: none !important;
}

.download-button {
    background: #007cba;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.download-button:hover {
    background: #005a87;
}

.download-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.download-button.downloading {
    background: #666;
}

.download-button.downloading:after {
    content: "...";
    animation: downloading 1s infinite;
}

@keyframes downloading {
    0%, 20% { content: "."; }
    40% { content: ".."; }
    60%, 100% { content: "..."; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .download-item {
        flex-direction: column;
        text-align: center;
    }
    
    .download-thumbnail {
        width: 60px;
        height: 60px;
        margin: 0 auto;
    }
    
    .download-meta {
        justify-content: center;
        font-size: 0.8em;
    }
}

@media (max-width: 480px) {
    .download-meta {
        flex-direction: column;
        gap: 5px;
        align-items: center;
    }
    
    .download-meta span:before {
        display: none;
    }
}

/* Loading state */
.downloads-list.loading {
    opacity: 0.6;
    pointer-events: none;
}

.downloads-list.loading:after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ccc;
    border-top-color: #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.downloads-accordion {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.downloads-accordion .accordion-item {
    border-bottom: 1px solid #e0e0e0;
}

.downloads-accordion .accordion-item:last-child {
    border-bottom: none;
}

.downloads-accordion .accordion-header {
    margin: 0;
    font-size: 1.1em;
}

.downloads-accordion .accordion-button {
    width: 100%;
    text-align: left;
    background: #fff;
    border: none;
    padding: 15px 40px 15px 20px;
    font-size: 1em;
    font-weight: 600;
    color: #2c3e50;
    cursor: pointer;
    transition: background-color 0.3s ease;
    position: relative;
    outline: none;
}

.downloads-accordion .accordion-button:hover {
    background-color: #f8f9fa;
}

.downloads-accordion .accordion-button::after {
    content: '+';
    font-size: 1.2em;
    line-height: 1;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.3s ease;
    color: #3498db;
}

.downloads-accordion .accordion-button.active {
    background-color: #3498db;
    color: #fff;
}

.downloads-accordion .accordion-button.active::after {
    content: '−';
    color: #fff;
}

.download-item-simple {
    padding: 12px 20px;
    border-bottom: 1px solid #ecf0f1;
}

.download-item-simple:last-child {
    border-bottom: none;
}

.download-item-simple a {
    text-decoration: none;
    color: #2c3e50;
    transition: color 0.2s ease;
}

.download-item-simple a:hover {
    color: #3498db;
}

