/* Downloads page */
.downloads-hero {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 50%, #667eea 100%);
    color: #fff;
    padding: 3rem 0;
    margin-bottom: 2rem;
}

.downloads-hero-title {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.downloads-hero-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 0;
    max-width: 600px;
}

.hero-stat {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    padding: 1.25rem 1.75rem;
    display: inline-block;
    text-align: center;
}

.hero-stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}

.hero-stat-label {
    font-size: 0.85rem;
    opacity: 0.85;
}

.downloads-page {
    padding-bottom: 3rem;
}

/* Categories sidebar */
.categories-panel {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
    position: sticky;
    top: 1rem;
}

.categories-panel-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1e3a5f;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e9ecef;
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-item a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    text-decoration: none;
    color: #495057;
    transition: background 0.2s, color 0.2s;
    margin-bottom: 0.25rem;
}

.category-item a:hover {
    background: #f0f4ff;
    color: #667eea;
}

.category-item.active a {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.category-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.category-item.active .category-icon {
    background: rgba(255, 255, 255, 0.2);
}

.category-info {
    flex: 1;
    min-width: 0;
}

.category-name {
    font-weight: 500;
    font-size: 0.95rem;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-count {
    background: #e9ecef;
    color: #495057;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    flex-shrink: 0;
}

.category-item.active .category-count {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.category-empty {
    color: #6c757d;
    font-size: 0.9rem;
    padding: 0.5rem;
}

/* Applications panel */
.apps-panel {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
}

.apps-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.apps-panel-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: #1e3a5f;
    margin: 0;
}

.apps-count-badge {
    background: #e9ecef;
    color: #495057;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
}

.search-form {
    margin-bottom: 0.5rem;
}

.search-input-group .input-group-text {
    background: #f8f9fa;
    border-right: none;
}

.search-input-group .form-control {
    border-left: none;
}

.search-input-group .form-control:focus {
    box-shadow: none;
    border-color: #ced4da;
}

/* App cards */
.app-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s, box-shadow 0.25s;
}

.app-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.15);
}

.app-card-image {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8ecf4 100%);
}

.app-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #667eea;
    opacity: 0.5;
}

.app-card-body {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.app-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.35rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-category-tag {
    font-size: 0.75rem;
    color: #667eea;
    font-weight: 500;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.app-card-desc {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0.75rem;
    flex: 1;
}

.app-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid #f0f0f0;
}

.download-count {
    font-size: 0.8rem;
    color: #6c757d;
    white-space: nowrap;
}

.btn-download {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.4rem 0.85rem;
    border-radius: 6px;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.2s, transform 0.2s;
}

.btn-download:hover {
    color: #fff;
    opacity: 0.9;
    transform: scale(1.03);
}

.btn-download.disabled {
    background: #adb5bd;
    cursor: not-allowed;
    pointer-events: none;
}

/* Pagination */
.downloads-pagination {
    margin-top: 2rem;
}

.downloads-pagination .page-link {
    border-radius: 6px;
    margin: 0 2px;
    color: #667eea;
}

.downloads-pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 3.5rem;
    color: #dee2e6;
    margin-bottom: 1rem;
    display: block;
}

.empty-state h4 {
    color: #495057;
    margin-bottom: 0.5rem;
}

@media (max-width: 991px) {
    .categories-panel {
        position: static;
    }

    .downloads-hero-title {
        font-size: 1.75rem;
    }
}
