/* ═══════════════════════════════════════════════════════════════
   Link2Down — Main Stylesheet
   ═══════════════════════════════════════════════════════════════ */

/* ─── AD SLOTS ─────────────────────────────────────────────────── */

.ad-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 90px;
    margin: 24px auto;
    max-width: 100%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px;
}

.ad-label {
    font-size: 10px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 8px;
}

.ad-content {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 300px;
    min-height: 50px;
}

/* ─── TOAST NOTIFICATIONS ──────────────────────────────────────── */

#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 12px 18px;
    border-radius: 10px;
    background: #1f2937;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    max-width: 340px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
    word-wrap: break-word;
}

.toast-visible {
    opacity: 1;
    transform: translateY(0);
}

.toast-error {
    background: #b91c1c;
    border-left: 4px solid #7f1d1d;
}

.toast-success {
    background: #15803d;
    border-left: 4px solid #14532d;
}

.toast-info {
    background: #1e40af;
    border-left: 4px solid #1e3a8a;
}

/* ─── FORMAT CARDS ─────────────────────────────────────────────── */

.format-card {
    background: #0f172a;
    border: 2px solid #334155;
    border-radius: 12px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    user-select: none;
}

.format-card:hover {
    border-color: #3b82f6;
    background: #1e293b;
    transform: translateY(-1px);
}

.format-card.selected {
    border-color: #3b82f6;
    background: #1e3a8a;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.format-card .format-label {
    font-weight: 600;
    color: #e2e8f0;
    font-size: 14px;
    margin-bottom: 4px;
}

.format-card .format-size {
    font-size: 12px;
    color: #64748b;
}

.format-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.format-badge.sd  { background: #475569; color: #cbd5e1; }
.format-badge.hd  { background: #0369a1; color: #e0f2fe; }
.format-badge.uhd { background: #7c3aed; color: #f3e8ff; }
.format-badge.audio { background: #15803d; color: #dcfce7; }

.recommended-pill {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 4px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    text-transform: uppercase;
    margin-left: 6px;
}

/* ─── PLATFORM BADGE ───────────────────────────────────────────── */

.platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #93c5fd;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.platform-badge img {
    width: 16px;
    height: 16px;
}

/* ─── PROGRESS BAR ─────────────────────────────────────────────── */

#progress-container {
    margin-top: 16px;
}

#progress-bar {
    transition: width 0.3s ease;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

/* ─── BUTTONS ──────────────────────────────────────────────────── */

button {
    cursor: pointer;
    font-family: inherit;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* ─── CUSTOM SCROLLBAR ─────────────────────────────────────────── */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0f172a;
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* ─── ANIMATIONS ───────────────────────────────────────────────── */

@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ─── UTILITY ──────────────────────────────────────────────────── */

.hidden { display: none !important; }

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ─── RESPONSIVE ───────────────────────────────────────────────── */

@media (max-width: 640px) {
    .ad-content {
        min-width: 250px;
    }

    .format-card {
        padding: 10px;
    }

    .format-label {
        font-size: 12px;
    }

    #toast-container {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }

    .toast {
        max-width: 100%;
    }
}

/* ─── FOOTER ───────────────────────────────────────────────────── */

.site-footer {
    margin-top: 48px;
    padding: 32px 16px;
    text-align: center;
    color: #64748b;
    font-size: 13px;
    line-height: 1.6;
    border-top: 1px solid #1e293b;
}

.site-footer a {
    color: #64748b;
    text-decoration: none;
    transition: color 0.2s;
}

.site-footer a:hover {
    color: #3b82f6;
}

/* ─── RTL SUPPORT (Arabic) ─────────────────────────────────────── */

[dir="rtl"] body {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .format-badge {
    right: auto;
    left: 8px;
}

/* Ad Placeholder Styling - Remove border and background */
.ad-slot {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 10px 0 !important;
    margin: 15px 0 !important;
}

/* Remove any dashed/solid borders from ad containers */
.ad-slot > div,
.ad-slot > .ad-content {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Ensure ads are centered */
.ad-slot .ad-content {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

/* Hide all ADVERTISEMENT labels */
.ad-label,
[class*="ad-label"],
[id*="ad-label"],
.ad-slot > span,
.ad-slot > p {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0 !important;
    overflow: hidden !important;
}

/* Responsive Ad Display - Correct Version */
.ad-mobile {
    display: none;
    justify-content: center;
    align-items: center;
}
.ad-desktop {
    display: flex;
    justify-content: center;
    align-items: center;
}

@media (max-width: 768px) {
    .ad-desktop { display: none !important; }
    .ad-mobile { display: flex !important; }
}

@media (min-width: 769px) {
    .ad-mobile { display: none !important; }
    .ad-desktop { display: flex !important; }
}

/* Center all ad content */
.ad-content {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
}

.ad-content iframe,
.ad-content img,
.ad-content > div {
    margin: 0 auto !important;
    display: block !important;
}
