/* Downloads System Styles */

.downloads-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.downloads-header {
    margin-bottom: 30px;
    text-align: center;
}

.downloads-header h1 {
    color: #333;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.downloads-header p {
    color: #666;
    font-size: 1.1em;
}

/* Search and Filter Bar */
.downloads-search-bar {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.downloads-search-bar form {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.downloads-search-bar input[type="text"] {
    flex: 1;
    min-width: 200px;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.downloads-search-bar select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    background: white;
}

.downloads-search-bar button {
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.downloads-search-bar button:hover {
    background: #0056b3;
}

/* Featured Downloads */
.downloads-featured {
    margin-bottom: 40px;
}

.downloads-featured h2 {
    color: #333;
    font-size: 1.8em;
    margin-bottom: 20px;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}

.downloads-featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* Download Cards */
.download-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.download-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.download-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.download-card-icon {
    width: 40px;
    height: 40px;
    background: #007bff;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin-right: 15px;
}

.download-card-title {
    flex: 1;
}

.download-card-title h3 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 1.2em;
}

.download-card-title .category {
    color: #666;
    font-size: 0.9em;
}

.download-card-description {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.4;
}

.download-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 0.9em;
    color: #666;
}

.download-card-stats {
    display: flex;
    gap: 15px;
}

.download-card-actions {
    display: flex;
    gap: 10px;
}

.download-btn {
    padding: 8px 15px;
    background: #28a745;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.9em;
    transition: background 0.2s;
}

.download-btn:hover {
    background: #218838;
    color: white;
}

.download-btn.premium {
    background: #ffc107;
    color: #212529;
}

.download-btn.premium:hover {
    background: #e0a800;
}

.view-btn {
    padding: 8px 15px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.9em;
    transition: background 0.2s;
}

.view-btn:hover {
    background: #0056b3;
    color: white;
}

/* Downloads Grid */
.downloads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

/* Rating Stars */
.rating-stars {
    display: inline-flex;
    gap: 2px;
}

.rating-stars .star {
    color: #ffc107;
    font-size: 14px;
}

.rating-stars .star.empty {
    color: #dee2e6;
}

/* Tags */
.download-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.download-tag {
    background: #e9ecef;
    color: #495057;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.8em;
    text-decoration: none;
}

.download-tag:hover {
    background: #dee2e6;
    color: #495057;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 5px;
    color: #007bff;
}

.pagination a:hover {
    background: #f8f9fa;
}

.pagination .current {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* Loading and Empty States */
.downloads-loading {
    text-align: center;
    padding: 50px;
    color: #666;
}

.downloads-empty {
    text-align: center;
    padding: 50px;
    color: #666;
}

.downloads-empty h3 {
    color: #333;
    margin-bottom: 10px;
}

/* Download Status Messages */
.download-pending,
.download-rejected,
.download-unavailable {
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin: 20px 0;
}

.download-pending {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
}

.download-rejected {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
}

.download-unavailable {
    background: #e2e3e5;
    border: 1px solid #d6d8db;
}

.pending-notice,
.rejected-notice,
.unavailable-notice {
    max-width: 400px;
    margin: 0 auto;
}

.pending-notice h4,
.rejected-notice h4,
.unavailable-notice h4 {
    margin: 10px 0;
    font-size: 1.2em;
}

.pending-notice p,
.rejected-notice p,
.unavailable-notice p {
    margin: 8px 0;
    line-height: 1.5;
}

.pending-notice i {
    font-size: 2em;
    margin-bottom: 10px;
}

.rejected-notice i,
.unavailable-notice i {
    font-size: 2em;
    margin-bottom: 10px;
}

/* Dashboard Styles */
.dashboard-nav {
    display: flex;
    gap: 0;
    margin-bottom: 30px;
    border-bottom: 2px solid #e9ecef;
    overflow-x: auto;
}

.dashboard-nav .nav-item {
    padding: 15px 20px;
    text-decoration: none;
    color: #666;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.dashboard-nav .nav-item:hover {
    color: #007bff;
    background-color: #f8f9fa;
}

.dashboard-nav .nav-item.active {
    color: #007bff;
    border-bottom-color: #007bff;
    background-color: #f8f9fa;
}

.dashboard-content {
    margin-top: 20px;
}

.content-header {
    margin-bottom: 30px;
}

.content-header h2 {
    color: #333;
    font-size: 1.8em;
    margin-bottom: 5px;
}

.content-header p {
    color: #666;
    margin: 0;
}

/* Uploads Grid */
.uploads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.uploads-grid .download-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.uploads-grid .download-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* History List Styles */
.history-list {
    margin-bottom: 30px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 15px;
    transition: box-shadow 0.2s ease;
}

.history-item:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.history-thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.history-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.history-thumbnail .default-thumbnail {
    width: 100%;
    height: 100%;
    background: #6c757d;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
}

.history-info {
    flex: 1;
}

.history-info h4 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 1.1em;
}

.history-meta {
    color: #666;
    font-size: 0.9em;
    margin: 5px 0;
}

.history-description {
    color: #777;
    font-size: 0.9em;
    margin: 8px 0 0 0;
}

.history-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

/* Status Badges */
.status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
    text-transform: uppercase;
}

.status-approved {
    background-color: #d4edda;
    color: #155724;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-rejected {
    background-color: #f8d7da;
    color: #721c24;
}

.upload-date {
    color: #6c757d;
    font-size: 0.85em;
}

/* Download Stats */
.download-stats {
    display: flex;
    gap: 15px;
    margin: 10px 0;
}

.download-stats .stat {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #666;
    font-size: 0.9em;
}

.download-stats .stat i {
    width: 14px;
    height: 14px;
}

/* Custom Page Builder Styles */
.custom-page-status {
    margin-top: 8px;
    font-size: 12px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.active {
    background: #d4f6d4;
    color: #2d5a2d;
    border: 1px solid #a8e6a8;
}

.status-badge.inactive {
    background: #ffe8cc;
    color: #8b4000;
    border: 1px solid #ffcc99;
}

.actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.actions .btn {
    justify-content: flex-start;
    width: 100%;
    text-align: left;
}

.actions .btn i {
    width: 16px;
    margin-right: 8px;
}

/* Custom page builder button special styling */
.btn-primary.btn-sm {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none !important;
    color: white !important;
    transition: all 0.2s ease;
}

.btn-primary.btn-sm:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-info.btn-sm {
    background: #17a2b8 !important;
    border-color: #17a2b8 !important;
}

.btn-info.btn-sm:hover {
    background: #138496 !important;
    border-color: #117a8b !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .downloads-container {
        padding: 15px;
    }
    
    .downloads-search-bar form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .downloads-search-bar input[type="text"],
    .downloads-search-bar select,
    .downloads-search-bar button {
        width: 100%;
    }
    
    .downloads-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .downloads-featured-grid {
        grid-template-columns: 1fr;
    }
    
    .download-card-actions {
        flex-direction: column;
    }
    
    .download-card-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    .dashboard-nav {
        flex-direction: column;
        gap: 0;
    }
    
    .dashboard-nav .nav-item {
        border-bottom: 1px solid #e9ecef;
        border-right: none;
    }
    
    .uploads-grid {
        grid-template-columns: 1fr;
    }
    
    .history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .history-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Breadcrumb */
.breadcrumb {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 0.9em;
}

.breadcrumb a {
    color: #007bff;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background: #cce7ff;
    color: #055160;
    border: 1px solid #b6d4fe;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mb-20 { margin-bottom: 20px; }
.mt-20 { margin-top: 20px; }
.p-20 { padding: 20px; }
.hidden { display: none; }
