/* ===================================
   IPTV World - Complete Design System
   Optimized Fonts & Performance
   =================================== */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #e91e63;
    --primary-dark: #c2185b;
    --primary-light: #f48fb1;
    --dark: #1a1a2e;
    --light: #ffffff;
    --gray: #2d2d2d;
    --text: #1f2937;
    --text-muted: #6b7280;
    --success: #10b981;
    --error: #ef4444;
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 35px;
    
    --transition: all 0.2s ease;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    line-height: 1.6;
    color: var(--text);
    background: var(--light);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {    font-family: 'Inter', 'Cairo', sans-serif;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.02em;
    color: var(--dark);
}

a { color: inherit; text-decoration: none; transition: var(--transition); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.text-center { text-align: center; }
.hidden { display: none !important; }

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
    color: var(--dark);
    font-weight: 800;
}

/* ===== Header ===== */
.flix-header {
    background: var(--light);
    box-shadow: var(--shadow-md);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.flix-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo span {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--dark);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.05);
}

.logo span i { color: var(--primary); margin-right: 5px; }

/* ===== Mobile Menu ===== */
.mobile-menu-btn {
    display: none;
    background: none;    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--dark);
    padding: 0.5rem;
}

.mobile-nav {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
}

.mobile-nav.active { display: block; }

.mobile-nav-content {
    background: var(--light);
    height: 100%;
    width: 85%;
    max-width: 400px;
    margin-left: auto;
    padding: 2rem;
    overflow-y: auto;
}

.close-menu {
    position: absolute;
    top: 1rem; right: 1rem;
    background: none; border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--dark);
}

.mobile-menu-list { list-style: none; margin-top: 3rem; padding: 0; }

.mobile-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    color: var(--dark);
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: var(--transition);
    margin-bottom: 0.5rem;
    cursor: pointer;
}
.link-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.link-content i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.mobile-link:hover {
    background: var(--primary);
    color: var(--light);
}

.submenu-icon {
    transition: transform 0.3s ease;
    font-size: 0.9rem;
}

.submenu-toggle.active .submenu-icon {
    transform: rotate(180deg);
}

.submenu {
    list-style: none;
    padding: 0.5rem 0 0.5rem 3.5rem;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.submenu.show { max-height: 500px; }

.submenu li { margin-bottom: 0.25rem; }

.submenu a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.submenu a:hover {
    background: rgba(233, 30, 99, 0.1);
    color: var(--primary);
    padding-right: 1.25rem;
}

/* ===== Hero Section ===== */
.flix-hero {
    position: relative;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--dark) 0%, #16213e 100%);
    padding: 4rem 0;
    text-align: center;
}

.hero-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(26, 26, 46, 0.85);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    padding: 2rem;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: var(--light);
    margin-bottom: 1rem;
    font-weight: 800;
    text-shadow: 3px 3px 12px rgba(0,0,0,0.6);
    animation: fadeInUp 0.8s ease;
    letter-spacing: -0.03em;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.95);
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease 0.2s both;
    font-weight: 400;
    line-height: 1.8;
}
/* ===== Buttons ===== */
.flix-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
}

.flix-btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--light) !important;
    box-shadow: 0 8px 25px rgba(233, 30, 99, 0.4);
}

.flix-btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(233, 30, 99, 0.5);
}

/* ===== Apps Section ===== */
.apps-section {
    padding: 3rem 0;
    background: #f8f9fa;
    overflow: hidden;
}

.apps-scroll-container {
    position: relative;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 20px 0;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) #e9ecef;
}

.apps-scroll-container:active { cursor: grabbing; }

.apps-scroll-container::-webkit-scrollbar { height: 6px; }
.apps-scroll-container::-webkit-scrollbar-track {
    background: #e9ecef;
    border-radius: 10px;
    margin: 0 40px;
}

.apps-scroll-container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 10px;
    transition: var(--transition);
}

.apps-horizontal-list {
    display: flex;
    gap: 20px;
    padding: 0 20px;
    width: max-content;
}

.app-card-square {
    flex: 0 0 220px;
    background: var(--light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 2px solid transparent;
    animation: fadeIn 0.5s ease;
}

.app-card-square:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary);
}

.app-card-square .app-image {
    width: 100%;
    height: 140px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.app-card-square .app-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;    transition: transform 0.3s;
}

.app-card-square:hover .app-image img { transform: scale(1.1); }

.app-card-square .app-info {
    padding: 1rem;
    text-align: center;
}

.app-card-square .app-info h3 {
    font-size: 1.05rem;
    margin-bottom: 0.8rem;
    color: var(--dark);
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}

.app-card-square .flix-btn {
    width: 100%;
    justify-content: center;
    padding: 0.7rem;
    font-size: 0.85rem;
    border-radius: 25px;
}

/* Loading & Error */
.loading, .error, .no-apps {
    text-align: center;
    padding: 3rem;
    font-size: 1.1rem;
}

.loading { color: var(--primary); }

.error {
    color: var(--error);
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius-md);
    border: 1px solid var(--error);
}

/* ===== Quick Links ===== */
.quick-links { padding: 4rem 0; background: var(--light); }

.links-grid {
    display: grid;    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.link-card {
    background: var(--light);
    padding: 2.5rem 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    color: var(--text);
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    border: 2px solid transparent;
}

.link-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary);
}

.link-card i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.link-card h3 { margin-bottom: 0.5rem; font-weight: 700; }
.link-card p { color: var(--text-muted); font-size: 0.9rem; }

/* ===== Contact Section ===== */
.flix-contact {
    background: var(--gray);
    padding: 4rem 0;
    color: var(--light);
    text-align: center;
}

.flix-contact h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    font-weight: 800;
    color: var(--light);
}

.contact-info { margin-bottom: 2rem; }
.contact-info p { margin-bottom: 0.5rem; opacity: 0.9; }

.contact-link {
    color: var(--primary-light);    font-size: 1.3rem;
    font-weight: 700;
}

.contact-link:hover { color: var(--primary); }

.social-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.social-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    color: var(--light);
    font-weight: 700;
    transition: var(--transition);
}

.social-btn.whatsapp { background: linear-gradient(135deg, #25D366, #128c7e); }
.social-btn.telegram { background: linear-gradient(135deg, #0088cc, #00a8e8); }
.social-btn:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

/* ===== Footer ===== */
.flix-footer {
    background: var(--dark);
    color: var(--light);
    padding: 2rem 0;
    text-align: center;
}

.footer-text { color: rgba(255,255,255,0.6); font-size: 0.9rem; }

/* ===== Floating WhatsApp ===== */
.floating-contact-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #25D366, #128c7e);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;    color: white;
    font-size: 1.8rem;
    box-shadow: 0 8px 30px rgba(37, 211, 102, 0.4);
    transition: var(--transition);
    z-index: 9999;
    animation: float 3s ease-in-out infinite;
}

.floating-contact-btn:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 12px 40px rgba(37, 211, 102, 0.6);
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ===== Animations ===== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

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

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .mobile-menu-btn { display: block; }
    
    .app-card-square { flex: 0 0 180px; }
    .app-card-square .app-image { height: 110px; }
    .app-card-square .app-info h3 { font-size: 0.95rem; }
    
    .apps-scroll-container::-webkit-scrollbar-track { margin: 0 20px; }
    
    .hero-title { font-size: 2rem; }
    
    .floating-contact-btn {
        width: 55px;
        height: 55px;
        font-size: 1.5rem;
        bottom: 20px;
        right: 20px;
    }
    
    .section-title { font-size: 1.5rem; }
}

/* ===== Print & Accessibility ===== */@media print {
    .mobile-menu-btn, .floating-contact-btn, .mobile-nav { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
}