/**
 * Downloads page styles for Rajasthan Virtual Shiksha PWA
 */

/* Downloads Header */
.downloads-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.downloads-header-content h2 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.downloads-header-content p {
    margin: 0;
    opacity: 0.9;
}

.storage-info {
    min-width: 200px;
}

.storage-meter {
    height: 8px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 5px;
}

.storage-used {
    height: 100%;
    background-color: white;
    border-radius: 4px;
}

.storage-text {
    font-size: 0.8rem;
    margin: 0;
    text-align: right;
}

/* Filters Section */
.downloads-filters {
    margin-bottom: 20px;
}

.search-container {
    position: relative;
    margin-bottom: 15px;
}

#search-downloads {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.9rem;
}

.search-button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-button {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 6px 15px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-button:hover {
    background-color: rgba(var(--primary-color-rgb), 0.1);
}

.filter-button.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Downloads List */
.downloads-group {
    margin-bottom: 30px;
}

.downloads-group-title {
    font-size: 1.2rem;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.download-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.download-item {
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.download-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.download-icon.pdf {
    background-color: #F44336;
}

.download-icon.video {
    background-color: #2196F3;
}

.download-icon.image {
    background-color: #4CAF50;
}

.download-icon.audio {
    background-color: #9C27B0;
}

.download-icon.doc {
    background-color: #1565C0;
}

.download-info {
    flex: 1;
    min-width: 0; /* Allows text to truncate */
}

.download-info h4 {
    margin: 0 0 5px;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.download-info p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.download-actions {
    display: flex;
    gap: 5px;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.2s;
}

.btn-icon:hover {
    background-color: var(--bg-light);
    color: var(--primary-color);
}

/* Empty State */
.downloads-empty {
    padding: 40px 0;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 400px;
    margin: 0 auto;
}

.empty-state svg {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.empty-state h3 {
    margin: 0 0 10px;
    font-size: 1.2rem;
}

.empty-state p {
    margin: 0 0 20px;
    color: var(--text-muted);
}

/* Confirmation Dialog */
.confirmation-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.confirmation-dialog.show {
    opacity: 1;
    visibility: visible;
}

.dialog-content {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dialog-content h3 {
    margin-top: 0;
    margin-bottom: 15px;
}

.dialog-content p {
    margin-bottom: 20px;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .downloads-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .storage-info {
        width: 100%;
    }
    
    .download-items {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .filter-buttons {
        overflow-x: auto;
        padding-bottom: 10px;
        flex-wrap: nowrap;
    }
    
    .filter-button {
        white-space: nowrap;
    }
}
