/* --- DOWNLOAD PAGE LAYOUT --- */
:root {
    --ios-bg: #f2f2f7;
    --ios-card: #ffffff;
    --ios-blue: #0071e3;
    --ios-green: #34c759;
    --ios-red: #ff3b30;
    --ios-text: #1d1d1f;
    --ios-gray: #86868b;
    --ios-border: #e5e5ea;
}

/* Inherit Global Layout */
.app-store-layout {
    display: flex;
    min-height: 100vh;
    background: var(--ios-bg);
}

/* Sidebar Offset (Matches your theme) */
@media (min-width: 769px) {
    .app-store-layout {
        padding-left: 290px;
    }
}

.download-content-area {
    flex: 1;
    padding: 40px;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* --- APP HEADER --- */
.dl-app-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    background: var(--ios-card);
    padding: 20px;
    border-radius: 18px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.dl-app-icon {
    width: 80px;
    height: 80px;
    border-radius: 18px;
    border: 1px solid rgba(0,0,0,0.1);
    object-fit: cover;
}

.dl-app-info h1 {
    font-size: 24px;
    margin: 0 0 5px 0;
    color: var(--ios-text);
}

.dl-meta-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.dl-tag {
    font-size: 12px;
    background: var(--ios-bg);
    padding: 4px 10px;
    border-radius: 12px;
    color: var(--ios-gray);
    font-weight: 500;
}

/* --- TIMER SECTION --- */
.dl-timer-card {
    background: var(--ios-card);
    border-radius: 22px;
    padding: 40px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    position: relative;
    overflow: hidden;
}

.timer-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid var(--ios-border);
    border-top-color: var(--ios-blue);
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    color: var(--ios-blue);
    animation: spin 1s linear infinite;
}

.timer-circle.finished {
    animation: none;
    border-color: var(--ios-green);
    color: var(--ios-green);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.dl-status-text {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--ios-text);
}

/* Button with Encryption Logic */
.encrypted-dl-btn {
    background: var(--ios-blue);
    color: #fff;
    border: none;
    padding: 15px 40px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
    opacity: 0.5;
    pointer-events: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.encrypted-dl-btn.active {
    opacity: 1;
    pointer-events: auto;
    box-shadow: 0 4px 15px rgba(0, 113, 227, 0.4);
}

.encrypted-dl-btn:hover {
    transform: translateY(-2px);
    background: #0077ed;
}

/* --- VERSIONS TABLE --- */
.versions-section {
    background: var(--ios-card);
    border-radius: 18px;
    padding: 25px;
    margin-bottom: 30px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--ios-text);
}

.versions-table {
    width: 100%;
    border-collapse: collapse;
}

.versions-table th {
    text-align: left;
    color: var(--ios-gray);
    font-size: 13px;
    padding: 10px;
    border-bottom: 1px solid var(--ios-border);
}

.versions-table td {
    padding: 15px 10px;
    border-bottom: 1px solid var(--ios-border);
    font-size: 14px;
    color: var(--ios-text);
}

.versions-table tr:last-child td {
    border-bottom: none;
}

.ver-btn {
    background: #f2f2f7;
    color: var(--ios-blue);
    padding: 6px 16px;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
}

/* --- REPORT ISSUE --- */
.report-link {
    display: inline-block;
    margin-top: 10px;
    color: var(--ios-red);
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
}

.report-modal {
    display: none;
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    margin-top: 15px;
    border: 1px solid var(--ios-red);
}

.report-modal.open { display: block; }

/* --- RELATED RANDOM --- */
.related-random-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

/* Responsive */
@media (max-width: 768px) {
    .download-content-area {
        padding: 20px;
    }
    .dl-app-header {
        flex-direction: column;
        text-align: center;
    }
    .dl-meta-tags {
        justify-content: center;
    }
    .versions-table th:nth-child(2),
    .versions-table td:nth-child(2) {
        display: none; /* Hide size on mobile */
    }
}