/* Downloads Page Styles */
.downloads-hero {
    background: linear-gradient(135deg, rgba(0, 238, 255, 0.15) 0%, rgba(13, 13, 13, 1) 100%);
    padding: 140px 20px 60px;
    margin-top: 70px;
    border-bottom: 1px solid var(--border-color);
}

.downloads-hero h1 {
    font-family: var(--font-heading);
    font-size: 3rem;
    margin-bottom: 15px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 15px;
}

.downloads-hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    max-width: 600px;
}

.download-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    max-width: 900px;
}

.download-stats .stat {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: var(--transition);
}

.download-stats .stat:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
}

.download-stats .stat i {
    font-size: 2rem;
    color: var(--primary-color);
}

.download-stats .stat h3 {
    color: var(--text-color);
    margin-bottom: 5px;
    font-size: 1.8rem;
}

.download-stats .stat p {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.9rem;
}

.downloads-nav {
    background: var(--card-bg);
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 70px;
    z-index: 100;
}

.download-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    list-style: none;
    overflow-x: auto;
    padding: 10px 0;
}

.download-tabs li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 25px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    white-space: nowrap;
    transition: var(--transition);
}

.download-tabs li a:hover {
    background: rgba(0, 238, 255, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.download-tabs li a.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--secondary-color);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.active-downloads, .completed-downloads, .installed-games, .available-updates, .cloud-saves, .download-settings {
    padding: 60px 0;
}

.active-downloads {
    background: var(--secondary-color);
}

.completed-downloads {
    background: rgba(26, 26, 26, 0.8);
}

.installed-games {
    background: var(--secondary-color);
}

.available-updates {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(13, 13, 13, 1) 100%);
}

.cloud-saves {
    background: linear-gradient(135deg, rgba(0, 188, 212, 0.1) 0%, rgba(13, 13, 13, 1) 100%);
}

.download-settings {
    background: var(--secondary-color);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.btn-pause-all, .btn-resume-all, .btn-update-all {
    padding: 10px 20px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-pause-all:hover, .btn-resume-all:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-update-all {
    background: var(--primary-color);
    color: var(--secondary-color);
    border-color: var(--primary-color);
}

.btn-update-all:hover {
    background: transparent;
    color: var(--primary-color);
}

.sort-options select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
}

.search-installed {
    position: relative;
    width: 300px;
}

.search-installed input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-color);
}

.search-installed i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.cloud-stats {
    display: flex;
    align-items: center;
    gap: 15px;
}

.storage-used {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.storage-bar {
    width: 200px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.storage-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #00a8ff);
    border-radius: 4px;
}

.downloads-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.download-item {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
}

.download-item:hover {
    border-color: var(--primary-color);
}

.download-icon {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.download-info {
    flex: 1;
}

.download-name {
    color: var(--text-color);
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.download-size {
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 15px;
}

.download-progress {
    flex: 1;
    max-width: 400px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #00a8ff);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.download-speed {
    color: var(--primary-color);
    font-weight: 500;
}

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

.btn-pause, .btn-resume, .btn-cancel {
    width: 40px;
    height: 40px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-pause:hover, .btn-resume:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-cancel:hover {
    border-color: #ff4444;
    color: #ff4444;
}

.downloads-grid, .games-grid, .saves-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.completed-item, .game-item, .save-item {
    background: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.completed-item:hover, .game-item:hover, .save-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
}

.completed-image, .game-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.completed-content, .game-content, .save-content {
    padding: 20px;
}

.completed-name, .game-name {
    color: var(--text-color);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.completed-meta, .game-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.completed-actions, .game-actions {
    display: flex;
    gap: 10px;
}

.btn-play, .btn-launch, .btn-install, .btn-update, .btn-restore {
    flex: 1;
    padding: 8px 15px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-play, .btn-launch {
    background: var(--primary-color);
    color: var(--secondary-color);
}

.btn-play:hover, .btn-launch:hover {
    background: transparent;
    color: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
}

.btn-install, .btn-update {
    background: rgba(255, 193, 7, 0.1);
    color: #FFC107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.btn-install:hover, .btn-update:hover {
    background: #FFC107;
    color: var(--secondary-color);
}

.btn-restore {
    background: rgba(0, 188, 212, 0.1);
    color: #00BCD4;
    border: 1px solid rgba(0, 188, 212, 0.3);
}

.btn-restore:hover {
    background: #00BCD4;
    color: var(--secondary-color);
}

.updates-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.update-item {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid rgba(255, 193, 7, 0.3);
    display: flex;
    align-items: center;
    gap: 20px;
}

.update-badge {
    background: #FFC107;
    color: var(--secondary-color);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: bold;
}

.update-info {
    flex: 1;
}

.update-name {
    color: var(--text-color);
    margin-bottom: 5px;
}

.update-size {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.setting-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 25px;
    border: 1px solid var(--border-color);
}

.setting-card h3 {
    color: var(--text-color);
    margin-bottom: 20px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.setting-control {
    margin-bottom: 15px;
}

.setting-control input[type="range"] {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.setting-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
}

.speed-labels {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 5px;
}

.setting-control input[type="text"] {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-color);
    margin-bottom: 10px;
}

.btn-browse {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-browse:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
    margin-right: 15px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: var(--text-color);
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(30px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.switch-label {
    color: var(--text-color);
    font-size: 0.9rem;
}

.setting-control select {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-color);
    cursor: pointer;
}

.setting-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 10px;
}

/* Download Details Modal */
.download-details-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 4000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.download-details-modal.active {
    display: flex;
}

.download-details-modal .modal-content {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    width: 100%;
    border: 2px solid var(--primary-color);
    position: relative;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
    .downloads-hero h1 {
        font-size: 2.2rem;
    }
    
    .download-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .download-tabs {
        justify-content: flex-start;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .download-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .download-progress {
        max-width: none;
        width: 100%;
    }
    
    .download-actions {
        align-self: flex-end;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .download-stats {
        grid-template-columns: 1fr;
    }
    
    .downloads-grid, .games-grid, .saves-grid {
        grid-template-columns: 1fr;
    }
}