/* pages/downloads/downloads.css */

#mainContent {
    min-height: calc(100vh - 150px);
    padding: 80px 20px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.app-container {
    max-width: 1000px;
    margin: 0 auto;
}

/* App List View */
.app-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 30px;
}

.app-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.app-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px var(--card-shadow);
}

.app-card img {
    width: 120px;
    height: 120px;
    border-radius: 20px;
    object-fit: cover;
    margin-bottom: 15px;
}

.app-card h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text-primary);
}

/* App Detail View */
.app-detail {
    animation: fadeIn 0.5s ease-out;
}

.detail-header {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
}

.detail-icon {
    width: 180px;
    height: 180px;
    border-radius: 36px;
    object-fit: cover;
    box-shadow: 0 10px 30px var(--card-shadow);
}

.detail-info {
    flex: 1;
}

.detail-info h1 {
    font-size: 3rem;
    margin: 0 0 5px 0;
}

.detail-info .developer {
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 30px;
    display: block;
}

.platform-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.platform-btn {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.platform-btn:hover {
    background: var(--border-primary);
}

.platform-btn.active {
    background: var(--btn-accent);
    color: white;
    border-color: var(--btn-accent);
}

/* Share Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.share-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 450px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    animation: slideUp 0.3s ease;
}

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

.share-modal h3 {
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.share-app-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding: 15px;
    background: var(--bg-primary);
    border-radius: 12px;
}

.share-app-info img {
    width: 50px;
    height: 50px;
    border-radius: 10px;
}

.share-app-info h4 {
    margin: 0;
    font-size: 1rem;
}

.share-link-container {
    display: flex;
    gap: 10px;
}

.share-link-container input {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
    padding: 10px;
    border-radius: 8px;
    outline: none;
    font-size: 0.9rem;
}

#copyShareLink {
    background: var(--btn-accent);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
/* Platform Icon Scaling */
.platform-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 15px;
    min-width: 80px;
}

.platform-btn .icon {
    width: 32px;
    height: 32px;
    background-size: 291px 106px; /* 1164*(32/128) x 424*(32/128) */
}

/* Adjust background-position for 32x32 size (scale 0.25) */
.platform-btn .icon.android { background-position: 0 0; }
.platform-btn .icon.linux { background-position: -259px 0; } /* 1036 * 0.25 = 259 */
.platform-btn .icon.windows-11 { background-position: 0 -74px; } /* 296 * 0.25 = 74 */

/* Custom icons for iOS/Mac */
.platform-btn i {
    font-size: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.platform-btn.active {
    color: white;
}

.platform-btn.active .icon {
    filter: brightness(0) invert(1);
}

.btn-install {
    background: var(--btn-accent);
    color: white !important;
    padding: 12px 60px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: filter 0.3s, transform 0.2s;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: fit-content;
}

.btn-install i {
    font-size: 1.4rem;
}

.btn-install:hover {
    filter: brightness(1.1);
    transform: scale(1.02);
}

.btn-secondary-action {
    background: transparent;
    color: var(--text-primary);
    padding: 12px 20px;
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Screenshot Carousel */
.screenshot-carousel {
    position: relative;
    margin: 40px 0;
    overflow: hidden;
}

.screenshot-track {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding-bottom: 10px;
}

.screenshot-track::-webkit-scrollbar {
    height: 6px;
}

.screenshot-track::-webkit-scrollbar-thumb {
    background: var(--border-primary);
    border-radius: 10px;
}

.screenshot-track img {
    height: 480px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.version-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.version-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.2s, border-color 0.3s;
}

.version-item:hover {
    border-color: var(--btn-accent);
}

.version-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.version-tag {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.version-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    gap: 15px;
}

.version-badge {
    background: var(--btn-accent);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.version-changelog {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 10px 0;
}

.btn-download-sm {
    background: var(--border-primary);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s;
}

.btn-download-sm:hover {
    background: var(--btn-accent);
    color: white !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .detail-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .detail-info h1 {
        font-size: 2rem;
    }
}
