/* Enhanced Downloads CSS with Tag Functionality */

/* Guest User Login Prompt Styling */
.guest-login-prompt {
    text-align: center;
    padding: 20px;
    background: rgba(0, 123, 255, 0.1);
    border: 1px solid var(--color-primary);
    border-radius: 8px;
    margin: 10px 0;
    transition: all 0.3s ease;
}

.guest-login-prompt:hover {
    background: rgba(0, 123, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.2);
}

.guest-login-prompt .fas {
    font-size: 2em;
    color: var(--color-primary);
    margin-bottom: 10px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Download Header Info Styling */
.download-header-info {
    margin-bottom: 1.5rem !important;
    background: linear-gradient(135deg, rgba(255, 102, 0, 0.1), rgba(255, 102, 0, 0.05)) !important;
    border: 1px solid rgba(255, 102, 0, 0.3) !important;
}

.header-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    padding: 0.5rem 0;
}

.header-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.header-info-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-info-value {
    font-size: 1.1rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
    word-break: break-word;
}

/* Version Type Badge Styling */
.version-type-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid;
}

.version-type-release {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border-color: rgba(40, 167, 69, 0.4);
}

.version-type-beta {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border-color: rgba(255, 193, 7, 0.4);
}

.version-type-alpha {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    border-color: rgba(220, 53, 69, 0.4);
}

.version-type-patch {
    background: rgba(23, 162, 184, 0.2);
    color: #17a2b8;
    border-color: rgba(23, 162, 184, 0.4);
}

.version-type-hotfix {
    background: rgba(255, 102, 0, 0.2);
    color: #ff6600;
    border-color: rgba(255, 102, 0, 0.4);
}

/* Mobile responsiveness for header info */
@media (max-width: 768px) {
    .header-info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .header-info-item {
        text-align: center;
    }
}

/* Preview Images Styling */
.coddb-preview-images {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.coddb-preview-image {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid rgba(255, 102, 0, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

.coddb-preview-image:hover {
    border-color: #ff6600;
    transform: scale(1.1);
    z-index: 10;
    position: relative;
}

.coddb-preview-more {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 60px;
    background: rgba(255, 102, 0, 0.2);
    border: 2px dashed rgba(255, 102, 0, 0.5);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    font-weight: bold;
}

/* Larger preview images for detailed view */
.coddb-preview-images-large {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1rem 0;
    justify-content: flex-start;
}

.coddb-preview-image-large {
    flex: 0 0 calc(33.333% - 0.67rem); /* 3 images per row with gaps */
    max-width: 250px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid rgba(255, 102, 0, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

.coddb-preview-image-large:hover {
    border-color: #ff6600;
    transform: scale(1.05);
    z-index: 10;
}

/* Mobile responsiveness for preview images */
@media (max-width: 768px) {
    .coddb-preview-images-large {
        gap: 0.5rem;
    }
    
    .coddb-preview-image-large {
        flex: 0 0 calc(50% - 0.25rem); /* 2 images per row on mobile */
        height: 120px;
    }
}

@media (max-width: 480px) {
    .coddb-preview-image-large {
        flex: 0 0 100%; /* 1 image per row on very small screens */
        height: 180px;
    }
}

/* Tag Filter Section */
.downloads-tags-filter {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.downloads-tags-filter h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #495057;
    font-weight: 600;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.tag-filter {
    display: inline-block;
    padding: 6px 12px;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    color: #495057;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.tag-filter:hover {
    background: #007bff;
    color: #ffffff;
    border-color: #007bff;
    text-decoration: none;
}

.tag-filter.active {
    background: #007bff;
    color: #ffffff;
    border-color: #007bff;
}

.tag-filter.clear-filter {
    background: #dc3545;
    color: #ffffff;
    border-color: #dc3545;
}

.tag-filter.clear-filter:hover {
    background: #c82333;
    border-color: #bd2130;
}

.tag-count {
    opacity: 0.8;
    font-size: 11px;
    margin-left: 4px;
}

/* Tag Suggestions in Upload Form */
.tag-suggestions {
    margin-top: 10px;
}

.tag-suggestions small {
    display: block;
    margin-bottom: 8px;
    color: #6c757d;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-suggestion {
    padding: 4px 8px !important;
    font-size: 12px !important;
    border-radius: 12px !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tag-suggestion:hover {
    background: #007bff !important;
    color: #ffffff !important;
    border-color: #007bff !important;
}

.tag-suggestion small {
    opacity: 0.8;
    margin-left: 4px;
}

/* Download Card Tags */
.download-tags {
    margin: 10px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.download-tag {
    display: inline-block;
    padding: 4px 8px;
    background: #e9ecef;
    color: #495057;
    text-decoration: none;
    font-size: 12px;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.download-tag:hover {
    background: #007bff;
    color: #ffffff;
    text-decoration: none;
}

/* Download View Tags Section */
.download-tags-section {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.download-tags-section h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #495057;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-link {
    display: inline-block;
    padding: 8px 16px;
    background: #007bff;
    color: #ffffff !important;
    text-decoration: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.tag-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
    text-decoration: none;
    color: #ffffff !important;
}

/* File Upload Enhancements */
.file-info {
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-top: 10px;
}

.image-preview {
    margin-top: 10px;
    text-align: center;
}

.image-preview img {
    max-width: 100%;
    height: auto;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

/* Enhanced Search Bar */
.downloads-search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.downloads-search-form input[type="text"] {
    flex: 1;
    min-width: 200px;
    padding: 10px 15px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
}

.downloads-filter {
    padding: 10px 15px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    background: #ffffff;
    min-width: 120px;
}

.downloads-search-form button {
    padding: 10px 20px;
    background: #007bff;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.downloads-search-form button:hover {
    background: #0056b3;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .downloads-search-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .downloads-search-form input[type="text"],
    .downloads-filter {
        min-width: 100%;
    }
    
    .tag-cloud {
        justify-content: center;
    }
    
    .tag-filter {
        font-size: 12px;
        padding: 5px 10px;
    }
    
    .download-tags {
        justify-content: center;
    }
    
    .tags-list {
        justify-content: center;
    }
}

/* Enhanced Download Cards */
.download-card {
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.download-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #007bff;
}

.download-card-actions {
    padding: 15px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.download-card-actions .view-btn {
    display: inline-block;
    padding: 8px 16px;
    background: #28a745;
    color: #ffffff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    margin-right: 10px;
    transition: all 0.2s ease;
}

.download-card-actions .view-btn:hover {
    background: #218838;
    text-decoration: none;
    color: #ffffff;
}

/* Tag Animation */
.tag-filter, .tag-link, .download-tag {
    position: relative;
    overflow: hidden;
}

.tag-filter::before,
.tag-link::before,
.download-tag::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.tag-filter:hover::before,
.tag-link:hover::before,
.download-tag:hover::before {
    left: 100%;
}

/* Loading States */
.tag-loading {
    opacity: 0.6;
    pointer-events: none;
}

.tag-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced Featured Downloads */
.downloads-featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.download-card.featured {
    border: 2px solid #ffc107;
    position: relative;
}

.download-card.featured::before {
    content: '⭐ Featured';
    position: absolute;
    top: -1px;
    right: -1px;
    background: #ffc107;
    color: #212529;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 0 6px 0 6px;
}

/* Download Statistics */
.download-card-stats {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: #6c757d;
}

.download-card-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Enhanced Form Styling */
.upload-form .form-group {
    margin-bottom: 20px;
}

.upload-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #495057;
}

.upload-form .form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.upload-form .form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

.upload-form .form-text {
    margin-top: 5px;
    font-size: 12px;
    color: #6c757d;
}

.upload-form .btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
}

.upload-form .btn-primary {
    background: #007bff;
    color: #ffffff;
}

.upload-form .btn-primary:hover {
    background: #0056b3;
}

.upload-form .btn-secondary {
    background: #6c757d;
    color: #ffffff;
}

.upload-form .btn-secondary:hover {
    background: #545b62;
}

/* Alert Styling */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 6px;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

.alert ul {
    margin: 0;
    padding-left: 20px;
}

.alert li {
    margin-bottom: 5px;
}

.alert li:last-child {
    margin-bottom: 0;
}

/* Dashboard Styles */
.dashboard-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 1px solid #e9ecef;
}

.dashboard-nav {
    display: flex;
    gap: 0;
    margin-bottom: 30px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
}

.dashboard-nav .nav-item {
    flex: 1;
    padding: 15px 20px;
    text-align: center;
    color: #495057;
    text-decoration: none;
    border-right: 1px solid #dee2e6;
    transition: all 0.2s ease;
    font-weight: 500;
}

.dashboard-nav .nav-item:last-child {
    border-right: none;
}

.dashboard-nav .nav-item:hover {
    background: #f8f9fa;
    color: #007bff;
}

.dashboard-nav .nav-item.active {
    background: #007bff;
    color: #ffffff;
}

/* Dashboard Overview */
.dashboard-overview {
    display: grid;
    gap: 30px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-color: #007bff;
}

.stat-icon {
    font-size: 2rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 50%;
}

.stat-info h3 {
    margin: 0 0 5px 0;
    font-size: 1.5rem;
    color: #495057;
    font-weight: 600;
}

.stat-info p {
    margin: 0;
    color: #6c757d;
    font-size: 0.9rem;
}

.recent-activity {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.activity-section {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
}

.activity-section h3 {
    margin: 0 0 20px 0;
    color: #495057;
    font-size: 1.1rem;
    font-weight: 600;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 15px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.activity-item:hover {
    background: #e9ecef;
}

.activity-icon {
    font-size: 1.2rem;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-radius: 50%;
    border: 1px solid #dee2e6;
}

.activity-content {
    flex: 1;
}

.activity-title {
    color: #495057;
    text-decoration: none;
    font-weight: 500;
    display: block;
    margin-bottom: 2px;
}

.activity-title:hover {
    color: #007bff;
    text-decoration: none;
}

.activity-meta {
    margin: 0;
    font-size: 0.8rem;
    color: #6c757d;
}

.view-all-link {
    color: #007bff;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.view-all-link:hover {
    text-decoration: none;
    color: #0056b3;
}

.quick-actions {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
}

.quick-actions h3 {
    margin: 0 0 20px 0;
    color: #495057;
    font-size: 1.1rem;
    font-weight: 600;
}

.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Dashboard Content */
.dashboard-content {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 30px;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.content-header h2 {
    margin: 0;
    color: #495057;
}

.content-header p {
    margin: 5px 0 0 0;
    color: #6c757d;
}

/* Collections */
.collections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.collection-card {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.2s ease;
}

.collection-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-color: #007bff;
}

.collection-header h3 {
    margin: 0 0 10px 0;
    color: #495057;
}

.collection-meta {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 15px;
}

.visibility {
    padding: 2px 8px;
    background: #e9ecef;
    border-radius: 12px;
    font-size: 0.8rem;
}

.collection-description {
    color: #6c757d;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.collection-actions {
    display: flex;
    gap: 10px;
}

/* History */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.history-item:hover {
    background: #e9ecef;
    border-color: #007bff;
}

.history-info h4 {
    margin: 0 0 5px 0;
    color: #495057;
}

.history-meta {
    margin: 0;
    font-size: 0.9rem;
    color: #6c757d;
}

.history-actions {
    display: flex;
    gap: 10px;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state h3 {
    margin: 0 0 10px 0;
    color: #495057;
}

.empty-state p {
    margin: 0 0 20px 0;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #ffffff;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h3 {
    margin: 0;
    color: #495057;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #495057;
}

.modal form {
    padding: 20px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Favorite Button */
.favorite-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #6c757d;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.favorite-btn:hover {
    background: #f8f9fa;
    color: #ffc107;
}

.favorite-btn.active {
    color: #ffc107;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 30px;
}

.page-link {
    padding: 8px 12px;
    color: #007bff;
    text-decoration: none;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.page-link:hover {
    background: #e9ecef;
    text-decoration: none;
}

.page-link.active {
    background: #007bff;
    color: #ffffff;
    border-color: #007bff;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .downloads-search-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .downloads-search-form input[type="text"],
    .downloads-filter {
        min-width: 100%;
    }
    
    .tag-cloud {
        justify-content: center;
    }
    
    .tag-filter {
        font-size: 12px;
        padding: 5px 10px;
    }
    
    .download-tags {
        justify-content: center;
    }
    
    .tags-list {
        justify-content: center;
    }
    
    .dashboard-nav {
        flex-direction: column;
    }
    
    .dashboard-nav .nav-item {
        border-right: none;
        border-bottom: 1px solid #dee2e6;
    }
    
    .dashboard-nav .nav-item:last-child {
        border-bottom: none;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .recent-activity {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .collections-grid {
        grid-template-columns: 1fr;
    }
    
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .history-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .action-buttons {
        justify-content: center;
    }
}
