/* ============================== تحميل الوسائط - تنسيقات وأنميشن ============================== */

@keyframes mdlFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes mdlSlideUp { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes mdlPopIn { 0% { transform: scale(0.85); opacity: 0; } 60% { transform: scale(1.03); opacity: 1; } 100% { transform: scale(1); } }
@keyframes mdlSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes mdlPulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, .45); }
    50% { box-shadow: 0 0 0 14px rgba(46, 204, 113, 0); }
}
@keyframes mdlShake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-4px); }
    40%, 60% { transform: translateX(4px); }
}
@keyframes mdlProgressStripes {
    from { background-position: 0 0; }
    to { background-position: 40px 0; }
}
@keyframes mdlBounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.08); }
    70% { transform: scale(0.95); }
    100% { transform: scale(1); opacity: 1; }
}

.mdl-container { animation: mdlFadeIn .6s ease; }

.mdl-header { text-align: center; animation: mdlSlideUp .7s ease; }
.mdl-header h1 { color: #ff6600; font-size: 2.4em; margin: 10px 0; }
.mdl-header p { color: #aaa; font-size: 1.05em; }

.mdl-input-box {
    background: linear-gradient(135deg, #1a1d26 0%, #252b3a 100%);
    padding: 28px; border-radius: 16px; border: 2px solid #ff6600;
    margin: 28px 0; animation: mdlSlideUp .7s ease .05s backwards;
    transition: border-color .3s, box-shadow .3s;
}
.mdl-input-box:focus-within { border-color: #ff8a3d; box-shadow: 0 0 24px rgba(255,122,26,.25); }
.mdl-input-row { display: flex; gap: 10px; align-items: center; }
.mdl-input-row input {
    flex: 1; padding: 15px; border-radius: 10px; border: 1px solid #ff6600;
    background: #0d1117; color: #fff; font-size: 1em; transition: box-shadow .25s;
}
.mdl-input-row input:focus { outline: none; box-shadow: 0 0 0 3px rgba(255,122,26,.25); }
.mdl-hint { color: #888; font-size: .88em; margin: 12px 0 0; }

.mdl-btn-search {
    padding: 15px 30px; background: linear-gradient(135deg, #ff7a1a, #ff3d3d);
    border: none; border-radius: 10px; color: #fff; font-weight: bold; cursor: pointer;
    font-size: 1.05em; transition: transform .2s, box-shadow .2s;
    box-shadow: 0 4px 15px rgba(255,90,20,.4); white-space: nowrap;
}
.mdl-btn-search:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(255,90,20,.6); }
.mdl-btn-search:active:not(:disabled) { transform: translateY(0) scale(.97); }
.mdl-btn-search:disabled { opacity: .75; cursor: wait; }

.mdl-platforms-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 28px 0; }
@media (max-width: 700px) { .mdl-platforms-grid { grid-template-columns: 1fr; } }

.mdl-platform-card {
    background: #1a1d26; border-radius: 16px; padding: 20px;
    animation: mdlSlideUp .7s ease .1s backwards; transition: transform .25s;
}
.mdl-platform-card:hover { transform: translateY(-3px); }
.mdl-platform-card h3 { margin-top: 0; text-align: center; font-size: 1.25em; }
.mdl-supported { border: 2px solid #2ecc71; }
.mdl-supported h3 { color: #2ecc71; }
.mdl-protected { border: 2px solid #e74c3c; }
.mdl-protected h3 { color: #e74c3c; }
.mdl-emoji-row { text-align: center; font-size: 2.3em; margin: 12px 0; }
.mdl-platform-card ul { list-style: none; padding: 0; text-align: right; color: #aaa; }
.mdl-platform-card ul li { padding: 7px 0; }
.mdl-safe-note { color: #2ecc71; text-align: center; margin-top: 12px; font-size: .95em; }
.mdl-unsafe-note { color: #e74c3c; text-align: center; margin-top: 12px; font-size: .95em; }

.mdl-info-section {
    background: linear-gradient(135deg, #1a1d26 0%, #252b3a 100%);
    padding: 25px; border-radius: 16px; border-right: 5px solid #ff6600;
    animation: mdlFadeIn 1s ease .15s backwards;
}
.mdl-info-section h3 { color: #ff6600; margin-top: 0; }
.mdl-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 700px) { .mdl-info-grid { grid-template-columns: 1fr; } }
.mdl-info-grid ul { color: #aaa; margin: 0; padding-right: 18px; }
.mdl-drm-note {
    background: rgba(255,107,107,.1); padding: 15px; border-radius: 10px;
    margin-top: 15px; color: #ff6b6b; font-size: .95em; line-height: 1.6;
}

/* ------- بطاقة النتيجة (بحث ناجح) ------- */
.mdl-success-card {
    background: linear-gradient(135deg, #1a1d26, #252b3a);
    border: 2px solid #2ecc71; border-radius: 16px; padding: 26px;
    animation: mdlBounceIn .5s ease-out;
}
.mdl-success-card h2 { color: #2ecc71; margin-top: 0; }
.mdl-success-card .mdl-title { color: #ff6600; font-size: 1.1em; font-weight: bold; }
.mdl-success-card img.mdl-thumb {
    max-width: 100%; border-radius: 12px; margin: 15px 0;
    animation: mdlPopIn .5s ease-out;
}
.mdl-details { color: #aaa; font-size: .95em; line-height: 1.7; }
.mdl-quality-box { background: #0d1117; padding: 15px; border-radius: 10px; margin: 15px 0; }
.mdl-quality-box > p { color: #888; margin-top: 0; }
.mdl-badge-nowm {
    display: inline-block; margin-top: 6px; padding: 4px 10px; border-radius: 20px;
    background: rgba(46,204,113,.15); color: #2ecc71; font-size: .82em; font-weight: bold;
}

.mdl-btn-group { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.mdl-btn-quality {
    padding: 12px 22px; background: #232838; color: #fff; border: 1px solid #2c313c;
    border-radius: 10px; cursor: pointer; transition: all .25s; font-weight: bold; position: relative;
    overflow: hidden;
}
.mdl-btn-quality:hover:not(:disabled) {
    border-color: #ff7a1a; color: #ff8a3d; transform: translateY(-3px) scale(1.03);
    box-shadow: 0 6px 18px rgba(255,122,26,.3);
}
.mdl-btn-quality:active:not(:disabled) { transform: translateY(0) scale(.96); }
.mdl-btn-quality:disabled { cursor: wait; opacity: .85; }
.mdl-btn-quality.mdl-downloading { animation: mdlPulseGlow 1.2s infinite; border-color: #2ecc71; color: #2ecc71; }

.mdl-spinner {
    display: inline-block; width: 18px; height: 18px; border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%; border-top-color: #fff; animation: mdlSpin .8s linear infinite;
    vertical-align: middle; margin-left: 8px;
}

/* شريط تقدم وهمي أنيق أثناء التحميل (يعطي إحساس فخامة بدون بيانات تقدم فعلية من السيرفر) */
.mdl-progress-wrap { margin-top: 14px; background: #0d1117; border-radius: 20px; overflow: hidden; height: 10px; }
.mdl-progress-bar {
    height: 100%; width: 0%;
    background: repeating-linear-gradient(45deg, #ff7a1a, #ff7a1a 12px, #ff9a4d 12px, #ff9a4d 24px);
    background-size: 40px 40px;
    animation: mdlProgressStripes 1s linear infinite;
    transition: width .4s ease;
    border-radius: 20px;
}

/* ------- بطاقة النجاح النهائي (اكتمل التحميل) ------- */
.mdl-done-card {
    margin-top: 16px; padding: 16px; border-radius: 12px;
    background: rgba(46,204,113,.12); border: 1px solid #2ecc71; color: #2ecc71;
    animation: mdlBounceIn .45s ease-out; font-weight: bold; text-align: center;
}

/* ------- بطاقة الخطأ ------- */
.mdl-error-card {
    background: linear-gradient(135deg, #c0392b, #e74c3c); border-radius: 16px;
    padding: 26px; color: #fff; animation: mdlShake .5s ease, mdlSlideUp .4s ease;
}
.mdl-error-card h2 { margin-top: 0; }
.mdl-error-card .mdl-message { font-size: .95em; line-height: 1.7; }
.mdl-error-close {
    margin-top: 15px; width: 100%; padding: 10px; background: rgba(255,255,255,.2);
    border: none; color: #fff; border-radius: 8px; cursor: pointer; font-weight: bold;
    transition: background .2s;
}
.mdl-error-close:hover { background: rgba(255,255,255,.32); }
