/* ============ الأساسيات ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-card: #ffffff;
    --bg-input: #f1f3f5;
    --gold: #d4af37;
    --gold-light: #e0c050;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --error: #ef4444;
    --shadow-glow: 0 0 30px rgba(37, 99, 235, 0.1);
    --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.05);
    --radius: 20px;
    --radius-sm: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cairo', sans-serif;
    background: #f9fafb;
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    background-image: 
        radial-gradient(ellipse at 20% 50%, rgba(37, 99, 235, 0.03), transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(212, 175, 55, 0.03), transparent 60%);
    background-attachment: fixed;
}

.container {
    width: 100%;
    max-width: 950px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============ الإعلانات ============ */
.ad-banner {
    background: var(--bg-secondary);
    backdrop-filter: blur(5px);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 18px;
    text-align: center;
    margin: 15px auto;
    max-width: 950px;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.ad-label {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 11px;
    color: var(--text-muted);
    background: rgba(0,0,0,0.04);
    padding: 3px 12px;
    border-radius: 20px;
    letter-spacing: 1px;
}

.ad-placeholder {
    color: var(--text-muted);
    font-size: 15px;
}

/* ============ الهيدر ============ */
.site-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    padding: 18px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    font-size: 45px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.site-title {
    font-size: 34px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--gold), #b8941f);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
}

.site-tagline {
    font-size: 15px;
    color: var(--text-secondary);
    margin-top: -4px;
}

/* ============ القسم الرئيسي ============ */
.main-content {
    padding: 50px 0 70px;
}

/* ============ صندوق التحميل ============ */
.download-box {
    background: var(--bg-card);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: var(--radius);
    padding: 45px 35px;
    position: relative;
    overflow: hidden;
    margin-bottom: 35px;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
}

.download-box::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.08), transparent 70%);
    pointer-events: none;
}

.box-title {
    font-size: 28px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 10px;
    color: #1e293b;
}

.box-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 30px;
}

/* ============ حقل الإدخال ============ */
.input-group {
    margin-bottom: 22px;
}

.url-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 5px;
    transition: var(--transition);
    gap: 8px;
}

.url-input-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 25px rgba(37, 99, 235, 0.15);
}

.input-icon {
    color: var(--gold);
    font-size: 18px;
    margin: 0 10px;
    flex-shrink: 0;
}

.url-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 16px;
    padding: 15px 5px;
    outline: none;
    font-family: 'Cairo', sans-serif;
    min-width: 0;
}

.url-input::placeholder {
    color: var(--text-muted);
    font-size: 14px;
}

.paste-btn, .clear-btn {
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid var(--border);
    color: var(--accent);
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.paste-btn:hover, .clear-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.clear-btn {
    padding: 10px 12px;
}

/* ============ اختيار النوع ============ */
.type-selector {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    justify-content: center;
}

.type-label {
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 16px;
}

.type-buttons {
    display: flex;
    gap: 12px;
}

.type-btn {
    padding: 13px 28px;
    border: 2px solid var(--border);
    background: white;
    color: var(--text-secondary);
    border-radius: 50px;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-size: 15px;
    font-weight: 700;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.type-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.3);
}

.type-btn:hover:not(.active) {
    border-color: var(--accent);
    color: var(--accent);
}

/* ============ المنصات المدعومة ============ */
.supported-platforms {
    text-align: center;
    margin-bottom: 30px;
}

.platform-label {
    color: var(--text-muted);
    font-size: 14px;
    display: block;
    margin-bottom: 12px;
}

.platform-icons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.platform-icon {
    padding: 10px 18px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    background: rgba(0,0,0,0.02);
    border: 1px solid var(--border);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
}

.platform-icon.youtube { color: #ff0000; }
.platform-icon.facebook { color: #1877f2; }
.platform-icon.instagram { color: #e4405f; }
.platform-icon.tiktok { color: #00f2ea; }
.platform-icon.twitter { color: #1da1f2; }

.platform-icon:hover {
    background: white;
    transform: translateY(-3px);
    border-color: currentColor;
}

/* ============ زرار التحميل ============ */
.download-btn {
    display: block;
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
    padding: 18px 35px;
    background: linear-gradient(135deg, #d4af37, #b8941f);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 21px;
    font-weight: 800;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    transition: var(--transition);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.3);
    position: relative;
    overflow: hidden;
}

.download-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(212, 175, 55, 0.5);
    background: linear-gradient(135deg, #e0c050, #c9a420);
}

.download-btn:active {
    transform: translateY(0);
}

.download-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    filter: grayscale(20%);
}

/* ============ رسايل الحالة ============ */
.status-message {
    text-align: center;
    margin-top: 20px;
    padding: 15px 22px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 16px;
    display: none;
    animation: fadeInUp 0.3s ease;
}

.status-message.loading {
    background: rgba(212, 175, 55, 0.1);
    color: #b8941f;
    border: 1px solid rgba(212, 175, 55, 0.3);
    display: block;
}

.status-message.success {
    background: rgba(16, 185, 129, 0.1);
    color: #0f766e;
    border: 1px solid rgba(16, 185, 129, 0.3);
    display: block;
}

.status-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.3);
    display: block;
}

/* ============ منطقة النتائج ============ */
.result-area {
    margin-top: 25px;
    animation: fadeInUp 0.4s ease;
}

.video-preview {
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 22px;
    display: flex;
    gap: 20px;
    align-items: center;
    border: 1px solid var(--border);
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.video-preview img {
    width: 160px;
    height: 90px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
}

.video-info {
    flex: 1;
    min-width: 200px;
}

.video-info h4 {
    font-size: 17px;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.quality-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.quality-btn {
    padding: 10px 18px;
    background: white;
    border: 2px solid var(--border);
    color: var(--text-primary);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    transition: var(--transition);
    font-family: 'Cairo', sans-serif;
}

.quality-btn:hover, .quality-btn.selected {
    border-color: var(--accent);
    background: var(--accent);
    color: white;
}

.actual-download-btn {
    display: inline-block;
    margin-top: 15px;
    padding: 13px 30px;
    background: var(--success);
    color: white;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 800;
    font-size: 17px;
    border: none;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    transition: var(--transition);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
}

.actual-download-btn:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

/* ============ المميزات ============ */
.features-section {
    margin: 60px 0;
}

.section-title {
    text-align: center;
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 40px;
    color: #1e293b;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 22px;
}

.feature-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px 22px;
    text-align: center;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.feature-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent);
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.1);
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 18px;
}

.feature-card h3 {
    font-weight: 800;
    margin-bottom: 10px;
    font-size: 19px;
    color: #1e293b;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 15px;
}

/* ============ الأسئلة الشائعة ============ */
.faq-section {
    margin: 60px 0;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.faq-item {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 22px 28px;
    transition: var(--transition);
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.faq-item:hover {
    border-color: var(--gold);
    background: #fefce8;
}

.faq-item h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #b8941f;
}

.faq-item p {
    color: var(--text-secondary);
    font-size: 15px;
}

/* ============ المودال ============ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(6px);
}

.modal-content {
    background: white;
    padding: 45px 40px;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid var(--border);
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
}

.loader {
    width: 60px;
    height: 60px;
    border: 5px solid var(--border);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 21px;
    font-weight: 700;
    color: #1e293b;
}

/* ============ ستيكر تفادي (تم التحميل) ============ */
.sticker-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1100;
    animation: stickerPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.sticker-box {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(15px);
    border: 2px solid var(--gold);
    border-radius: 30px;
    padding: 30px 40px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.tafadi-face img {
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.2));
    /* الشفافية من الصورة نفسها (PNG) */
}

.sticker-text {
    font-size: 22px;
    font-weight: 800;
    color: #b8941f;
    margin: 0;
    letter-spacing: 0.5px;
}

@keyframes stickerPop {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    80% { transform: translate(-50%, -50%) scale(1.08); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============ الفوتر ============ */
.site-footer {
    background: white;
    border-top: 1px solid var(--border);
    padding: 30px;
    text-align: center;
    margin-top: 50px;
}

.site-footer p {
    color: var(--text-muted);
    font-size: 14px;
}

/* ============ تحسينات الموبايل ============ */
@media (max-width: 768px) {
    .site-title { font-size: 26px; }
    .download-box { padding: 30px 18px; }
    .box-title { font-size: 22px; }
    .type-selector { flex-direction: column; gap: 10px; }
    .url-input { font-size: 15px; }
    .download-btn { font-size: 19px; max-width: 100%; }
    .video-preview { flex-direction: column; }
    .video-preview img { width: 100%; height: auto; }
    .features-grid { grid-template-columns: 1fr; }
    .platform-icons { gap: 8px; }
    .platform-icon { font-size: 12px; padding: 6px 12px; }
}

@media (max-width: 480px) {
    .container { padding: 0 12px; }
    .site-title { font-size: 22px; }
    .logo-icon { font-size: 35px; }
    .box-title { font-size: 19px; }
    .paste-btn, .clear-btn { padding: 8px 12px; font-size: 12px; }
    .type-btn { padding: 10px 20px; font-size: 14px; }
}