:root {
    --primary-color: #6366f1;
    /* Indigo-500 */
    --primary-dark: #4338ca;
    --primary-light: #e0e7ff;
    --secondary-color: #f43f5e;
    /* Rose-500 */
    --accent-color: #f59e0b;
    /* Amber-500 */

    /* Modern Palette */
    --bg-body: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.7);
    --text-main: #0f172a;
    /* Slate-900 */
    --text-muted: #64748b;
    /* Slate-500 */
    --border-color: rgba(255, 255, 255, 0.5);

    /* Glass & Effects */
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.4);
    --shadow-sm: 0 4px 6px -1px rgba(99, 102, 241, 0.05), 0 2px 4px -1px rgba(99, 102, 241, 0.03);
    --shadow-md: 0 10px 15px -3px rgba(99, 102, 241, 0.08), 0 4px 6px -2px rgba(99, 102, 241, 0.04);
    --shadow-lg: 0 20px 25px -5px rgba(99, 102, 241, 0.1), 0 10px 10px -5px rgba(99, 102, 241, 0.04);
    --glow: 0 0 20px rgba(99, 102, 241, 0.15);

    --gradient-main: linear-gradient(135deg, #6366f1 0%, #d946ef 50%, #f43f5e 100%);
    --gradient-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.4) 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Cairo', 'Tajawal', sans-serif;
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* Soft math grid background */
    background-color: var(--bg-body);
    background-image:
        linear-gradient(rgba(79, 70, 229, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(79, 70, 229, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    position: relative;
}

/* Background Icons */
.math-bg-icons {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.icon-float {
    position: absolute;
    color: rgba(79, 70, 229, 0.05);
    /* Very subtle */
    font-size: 2rem;
    animation: float 6s ease-in-out infinite;
    animation-delay: calc(var(--i) * 0.5s);
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(10deg);
    }
}

/* Watermark Stamp (Page Level) */
.watermark-stamp {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    width: 500px;
    opacity: 0.03;
    /* Very faint */
    z-index: -2;
    pointer-events: none;
}

/* Utils */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.glass-effect {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm);
}

/* Modern Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 5px;
    border: 2px solid #f1f5f9;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Header */
.main-header {
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(255, 255, 255, 0.95);
    background-image:
        linear-gradient(rgba(99, 102, 241, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.05) 1px, transparent 1px);
    background-size: 30px 30px;
    border-bottom: 1px solid var(--border-color);
}

.main-header .container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.brand-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

/* Teacher Stamp */
.teacher-stamp {
    height: 90px;
    object-fit: contain;
    margin-bottom: 8px;
    filter: drop-shadow(0 8px 16px rgba(99, 102, 241, 0.15));
    transition: transform 0.3s ease;
}

.teacher-stamp:hover {
    transform: scale(1.05) rotate(-2deg);
}

.logo-text h1 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 0px;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.logo-text .teacher-name {
    font-size: 1.1rem;
    color: var(--primary-color);
    font-weight: 800;
    display: block;
}

.school-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(243, 244, 246, 0.9));
    padding: 10px 24px;
    border-radius: 50px;
    margin-top: 15px;
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary-dark);
    border: 1px solid rgba(99, 102, 241, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.school-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.4);
}

.school-badge i {
    color: var(--secondary-color);
    font-size: 1.2rem;
    filter: drop-shadow(0 2px 4px rgba(236, 72, 153, 0.3));
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 3rem 0;
}

.hero-section h2 {
    font-size: 3.5rem;
    line-height: 1.5;
    font-weight: 900;
    margin-bottom: 1.5rem;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 4px rgba(99, 102, 241, 0.1));
}

.hero-section p {
    font-size: 1.1rem;
    color: var(--text-muted);
}

/* Cards */
.downloads-section {
    padding-bottom: 4rem;
    flex: 1;
}

.card {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--glass-border);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: var(--shadow-lg), var(--glow);
    border-color: rgba(99, 102, 241, 0.3);
}

/* Card Watermark */
.card-stamp-watermark {
    position: absolute;
    bottom: -20px;
    right: -20px;
    width: 120px;
    opacity: 0.05;
    transform: rotate(15deg);
    pointer-events: none;
}

/* Decorative top border for cards */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: var(--gradient-main);
}

.card-icon {
    width: 70px;
    height: 70px;
    background: white;
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.card:hover .card-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 15px rgba(99, 102, 241, 0.15);
}

.card-icon .number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
    background: none;
    -webkit-text-fill-color: initial;
    filter: none;
}

.card-content {
    width: 100%;
    z-index: 1;
}

.card-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    font-weight: 800;
}

.card-content p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* Download Stats */
.download-stats {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    color: var(--text-main);
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.5);
    padding: 10px 24px;
    border-radius: 50px;
    border: 1px solid var(--primary-light);
    font-weight: 700;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.download-stats i {
    color: var(--primary-color);
    filter: drop-shadow(0 2px 4px rgba(99, 102, 241, 0.2));
}



.actions {
    width: 100%;
}

.btn {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 16px 32px;
    border-radius: 16px;
    text-decoration: none;
    font-weight: 800;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-main);
    color: white;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.btn-primary:hover::after {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.6);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn:hover i {
    animation: bounce 1s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

/* Footer */
.main-footer {
    background-color: rgba(255, 255, 255, 0.95);
    background-image:
        linear-gradient(rgba(99, 102, 241, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.05) 1px, transparent 1px);
    background-size: 30px 30px;
    backdrop-filter: blur(10px);
    padding: 4rem 0 2rem;
    text-align: center;
    border-top: 1px solid var(--glass-border);
    margin-top: auto;
    position: relative;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.03);
}

.main-footer .slogan {
    font-family: 'Tajawal', sans-serif;
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: 700;
    margin: 1.5rem 0;
    position: relative;
    display: inline-block;
}

.main-footer .slogan::before,
.main-footer .slogan::after {
    content: '•';
    color: var(--secondary-color);
    margin: 0 10px;
    opacity: 0.6;
}

.footer-stamp-wrapper {
    margin-bottom: 2rem;
}

.footer-stamp {
    height:100px;
    opacity: 0.8;
    filter: grayscale(20%);
    transition: all 0.3s;
}

.footer-stamp:hover {
    filter: grayscale(0%);
    transform: scale(1.05) rotate(5deg);
}

.main-footer h3 {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.social-link {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    color: var(--text-main);
    font-size: 1.4rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

.social-link:hover {
    transform: translateY(-5px) rotate(10deg);
    color: white;
    border-color: transparent;
}

.tiktok:hover {
    background: #000000;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.instagram:hover {
    background: #d62976;
    box-shadow: 0 10px 20px rgba(214, 41, 118, 0.3);
}

.facebook:hover {
    background: #1877f2;
    box-shadow: 0 10px 20px rgba(24, 119, 242, 0.3);
}

.copyright {
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid #f1f5f9;
    padding-top: 1.5rem;
    width: 80%;
    margin: 0 auto;
}

/* Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-up {
    opacity: 0;
    animation: slideUp 0.6s ease forwards;
}

.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

.delay-3 {
    animation-delay: 0.6s;
}

/* Responsive Desktop */
@media (min-width: 768px) {
    .downloads-section .container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
        max-width: 900px;
    }
}

/* Geometric Shapes */
.geo-shape {
    position: absolute;
    opacity: 0.1;
    z-index: -1;
    pointer-events: none;
}

.geo-shape.circle {
    width: 60px;
    height: 60px;
    border: 4px solid var(--secondary-color);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite reverse;
}

.geo-shape.triangle {
    width: 0;
    height: 0;
    border-left: 30px solid transparent;
    border-right: 30px solid transparent;
    border-bottom: 50px solid var(--primary-color);
    background: transparent;
    animation: float 7s ease-in-out infinite;
    transform-origin: center;
}

.geo-shape.square {
    width: 50px;
    height: 50px;
    border: 4px solid var(--accent-color);
    transform: rotate(45deg);
    animation: float 9s ease-in-out infinite;
}

.geo-shape.grid-pattern {
    width: 200px;
    height: 200px;
    background-image: linear-gradient(var(--primary-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--primary-color) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.15;
    animation: float 10s ease-in-out infinite;
}

/* Ruler-like Grid Pattern on sides */
body::before,
body::after {
    content: '';
    position: fixed;
    top: 0;
    bottom: 0;
    width: 25px;
    background-image: linear-gradient(to bottom, var(--text-muted) 1px, transparent 1px);
    background-size: 100% 25px;
    opacity: 0.15;
    z-index: -2;
}

body::before {
    left: 0;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
}

body::after {
    right: 0;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
}