/* إعدادات عامة */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* نظام ألوان احترافي حديث */
    --primary-color: #1a237e;        /* أزرق داكن ملكي */
    --primary-light: #3949ab;        /* أزرق فاتح */
    --primary-dark: #0d1642;         /* أزرق غامق جداً */

    --secondary-color: #00897b;      /* تركواز أنيق */
    --secondary-light: #4db6ac;      /* تركواز فاتح */
    --secondary-dark: #00695c;       /* تركواز داكن */

    --accent-color: #ff6f00;         /* برتقالي حيوي */
    --accent-light: #ffa726;         /* برتقالي فاتح */

    --success-color: #2e7d32;        /* أخضر نجاح */
    --warning-color: #f57c00;        /* برتقالي تحذير */
    --danger-color: #c62828;         /* أحمر خطر */

    --bg-gradient-1: #667eea;        /* بنفسجي جميل */
    --bg-gradient-2: #764ba2;        /* بنفسجي داكن */

    --light-bg: #f5f7fa;             /* خلفية فاتحة جداً */
    --card-bg: #ffffff;              /* أبيض للبطاقات */

    --dark-text: #1a1a2e;            /* نص داكن */
    --medium-text: #4a5568;          /* نص متوسط */
    --light-text: #718096;           /* نص فاتح */
    --white: #ffffff;

    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.16);
    --shadow-xl: 0 12px 48px rgba(0,0,0,0.2);

    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #00897b 0%, #4db6ac 100%);
    --gradient-accent: linear-gradient(135deg, #ff6f00 0%, #ffa726 100%);
}

body {
    font-family: 'Tajawal', 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.8;
    color: var(--dark-text);
    background-color: var(--light-bg);
    direction: rtl;
    font-weight: 400;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: var(--gradient-primary);
    color: var(--white);
    padding: 3rem 0;
    text-align: center;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>');
    opacity: 0.3;
}

header h1 {
    font-family: 'Cairo', 'Tajawal', sans-serif;
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.3);
    position: relative;
    z-index: 1;
}

.subtitle {
    font-family: 'Tajawal', sans-serif;
    font-size: 1.3rem;
    font-weight: 300;
    opacity: 0.95;
    position: relative;
    z-index: 1;
}

/* Navigation */
.main-nav {
    background-color: var(--white);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.main-nav .container {
    position: relative;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.mobile-menu-toggle span {
    width: 30px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translateY(10px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translateY(-10px);
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0;
}

.main-nav li {
    margin: 0;
}

.main-nav a {
    display: block;
    padding: 1.2rem 1.8rem;
    color: var(--dark-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 3px solid transparent;
    position: relative;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 50%;
    left: 50%;
    height: 3px;
    background: var(--gradient-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-nav a:hover::after,
.main-nav a.active::after {
    right: 0;
    left: 0;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--primary-color);
    background: linear-gradient(to bottom, transparent, rgba(102, 126, 234, 0.05));
}

/* Sections */
.section {
    display: none;
    padding: 3rem 0;
    min-height: calc(100vh - 200px);
}

.section.active {
    display: block;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section h2 {
    font-family: 'Cairo', sans-serif;
    text-align: center;
    color: var(--primary-color);
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    position: relative;
    padding-bottom: 1.2rem;
}

.section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 50%;
    transform: translateX(50%);
    width: 120px;
    height: 5px;
    background: var(--gradient-primary);
    border-radius: 10px;
}

/* Hero Section */
#home {
    background: var(--gradient-primary);
    padding: 5rem 0;
    position: relative;
    overflow: hidden;
}

#home::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255,255,255,0.1) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    margin-top: 2rem;
    position: relative;
    z-index: 1;
}

.hero-content h2 {
    font-family: 'Cairo', sans-serif;
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--white);
    margin-bottom: 1.5rem;
    text-align: right;
    line-height: 1.3;
}

.hero-content h2::after {
    display: none;
}

.hero-content p {
    font-size: 1.4rem;
    color: var(--white);
    font-weight: 300;
    margin-bottom: 2rem;
    opacity: 0.95;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Newton's Balls Animation */
.newton-balls {
    display: flex;
    gap: 5px;
    align-items: flex-end;
    height: 200px;
    position: relative;
    justify-content: center;
}

.ball {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #ffa726, #ff6f00);
    border-radius: 50%;
    box-shadow: 0 8px 20px rgba(255, 111, 0, 0.4);
    position: relative;
}

.ball::before {
    content: '';
    position: absolute;
    top: -150px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 150px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.3), rgba(255,255,255,0.6));
}

.ball::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 8px;
    width: 15px;
    height: 15px;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.8), transparent);
    border-radius: 50%;
}

.ball:nth-child(1) {
    animation: swing-left 1.5s ease-in-out infinite;
    transform-origin: center -150px;
}

.ball:nth-child(5) {
    animation: swing-right 1.5s ease-in-out infinite;
    transform-origin: center -150px;
}

@keyframes swing-left {
    0% {
        transform: rotate(-35deg);
    }
    50% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(-35deg);
    }
}

@keyframes swing-right {
    0% {
        transform: rotate(35deg);
    }
    50% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(35deg);
    }
}

/* Cards */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
    margin: 3rem 0;
}

.card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(102, 126, 234, 0.1);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.card:hover::before {
    transform: scaleX(1);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(102, 126, 234, 0.3);
}

.card h3 {
    font-family: 'Cairo', sans-serif;
    color: var(--primary-color);
    margin-bottom: 1.2rem;
    font-size: 1.7rem;
    font-weight: 700;
}

.card h4 {
    font-family: 'Cairo', sans-serif;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
    font-weight: 600;
}

.card p {
    color: var(--medium-text);
    line-height: 1.9;
    font-size: 1.05rem;
}

.card.highlight {
    border: 3px solid var(--primary-color);
    background: linear-gradient(135deg, #ffffff 0%, rgba(102, 126, 234, 0.05) 100%);
    box-shadow: var(--shadow-lg);
}

/* Law Box */
.law-box {
    background: var(--gradient-primary);
    color: var(--white);
    padding: 3rem;
    border-radius: 20px;
    margin: 3rem 0;
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
}

.law-box::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.law-box h3 {
    font-family: 'Cairo', sans-serif;
    color: var(--white);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.law-statement {
    font-size: 1.3rem;
    line-height: 2;
    position: relative;
    z-index: 1;
}

.formula {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 15px;
    font-size: 1.8rem;
    text-align: center;
    margin-top: 1rem;
    font-weight: bold;
    letter-spacing: 3px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.3);
}

/* Interactive Demos */
.interactive-demo {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 20px;
    margin: 3rem 0;
    box-shadow: var(--shadow-md);
    border: 2px solid rgba(102, 126, 234, 0.1);
    transition: all 0.3s ease;
}

.interactive-demo:hover {
    box-shadow: var(--shadow-lg);
    border-color: rgba(102, 126, 234, 0.2);
}

.interactive-demo h3 {
    font-family: 'Cairo', sans-serif;
    color: var(--primary-color);
    margin-bottom: 2rem;
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
}

canvas {
    display: block;
    margin: 1.5rem auto;
    border: 3px solid #e8eaf6;
    border-radius: 15px;
    background: #fafbfc;
    max-width: 100%;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

canvas:hover {
    box-shadow: var(--shadow-md);
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    align-items: center;
    margin-top: 1.5rem;
    padding: 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    box-shadow: var(--shadow-sm);
}

.controls label {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--dark-text);
}

.controls input[type="range"] {
    width: 220px;
    cursor: pointer;
    height: 8px;
    background: linear-gradient(to left, #667eea, #764ba2);
    border-radius: 10px;
    outline: none;
    transition: all 0.3s ease;
}

.controls input[type="range"]:hover {
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

.controls input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 3px 8px rgba(102, 126, 234, 0.4);
    transition: all 0.2s ease;
}

.controls input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.controls input[type="range"]::-moz-range-thumb {
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 3px 8px rgba(102, 126, 234, 0.4);
    border: none;
    transition: all 0.2s ease;
}

.controls input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
}

.controls select {
    padding: 0.7rem 1.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 500;
    cursor: pointer;
    background-color: white;
    transition: all 0.3s ease;
    font-family: 'Tajawal', sans-serif;
}

.controls select:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.2);
}

.controls select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.3);
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.btn-primary::before,
.btn-secondary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before,
.btn-secondary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--white);
    position: relative;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary-color);
    border: 3px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary:active {
    transform: translateY(-1px);
}

/* Calculator */
.calculator-box {
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 20px;
    margin: 3rem 0;
    box-shadow: var(--shadow-lg);
    border: 2px solid rgba(102, 126, 234, 0.1);
}

.calculator {
    max-width: 550px;
    margin: 0 auto;
}

.calc-input {
    margin-bottom: 1.5rem;
}

.calc-input label {
    display: block;
    margin-bottom: 0.8rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color);
    font-family: 'Cairo', sans-serif;
}

.calc-input input {
    width: 100%;
    padding: 1rem 1.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    font-family: 'Tajawal', sans-serif;
    background: #fafbfc;
}

.calc-input input:hover {
    border-color: #bdbdbd;
}

.calc-input input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--white);
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.2);
}

.calc-result {
    margin-top: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(0, 137, 123, 0.1), rgba(77, 182, 172, 0.1));
    border-right: 6px solid var(--secondary-color);
    border-radius: 15px;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--secondary-dark);
    box-shadow: var(--shadow-md);
    font-family: 'Cairo', sans-serif;
}

.calc-result strong {
    color: var(--secondary-color);
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

.calc-result small {
    display: block;
    margin-top: 1rem;
    color: var(--medium-text);
    font-size: 1rem;
    font-weight: 400;
}

/* Experiment Steps */
.experiment-steps ol,
.experiment-steps ul {
    margin-right: 1.5rem;
}

.experiment-steps li {
    margin-bottom: 0.8rem;
    line-height: 1.6;
}

.experiment-steps h4 {
    color: var(--secondary-color);
    margin: 1rem 0 0.5rem;
}

.experiment-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 10px;
    margin: 2rem 0;
    box-shadow: var(--shadow);
}

.demo-explanation {
    text-align: center;
    color: #5a6c7d;
    font-style: italic;
    margin-top: 1rem;
    font-size: 1.05rem;
}

.demo-info {
    text-align: center;
    padding: 1.2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    margin-top: 1rem;
    font-weight: 600;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.demo-info p {
    color: white;
    margin: 0.3rem 0;
}

.demo-info span {
    color: #ffd700;
    font-size: 1.3rem;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

/* Quiz */
.quiz-container {
    max-width: 850px;
    margin: 0 auto;
}

.question-card {
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 2px solid rgba(102, 126, 234, 0.1);
}

.question-card h3 {
    font-family: 'Cairo', sans-serif;
    color: var(--primary-color);
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid rgba(102, 126, 234, 0.2);
    font-size: 1.5rem;
    font-weight: 700;
}

#questionText {
    font-size: 1.4rem;
    margin-bottom: 2.5rem;
    line-height: 2;
    color: var(--dark-text);
    font-weight: 500;
}

#answersContainer {
    margin-bottom: 2.5rem;
}

.answer-option {
    background: linear-gradient(135deg, #fafbfc 0%, #f0f2f5 100%);
    padding: 1.3rem 2rem;
    margin-bottom: 1.2rem;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 3px solid #e1e8ed;
    font-size: 1.15rem;
    font-weight: 500;
}

.answer-option:hover {
    background: var(--gradient-primary);
    color: var(--white);
    border-color: transparent;
    transform: translateX(-8px);
    box-shadow: var(--shadow-md);
}

.answer-option.selected {
    background: var(--gradient-primary);
    color: var(--white);
    border-color: transparent;
    box-shadow: var(--shadow-md);
}

.answer-option.correct {
    background: var(--gradient-secondary);
    color: var(--white);
    border-color: transparent;
    box-shadow: 0 5px 15px rgba(0, 137, 123, 0.4);
    animation: correctPulse 0.5s ease;
}

@keyframes correctPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.answer-option.incorrect {
    background: var(--gradient-accent);
    color: var(--white);
    border-color: transparent;
    box-shadow: 0 5px 15px rgba(255, 111, 0, 0.4);
    animation: incorrectShake 0.5s ease;
}

@keyframes incorrectShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.result-box {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    padding: 3.5rem;
    border-radius: 25px;
    text-align: center;
    margin-bottom: 3rem;
    border: 4px solid var(--primary-color);
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
}

.result-box::before {
    content: '🎉';
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 3rem;
    opacity: 0.3;
}

.result-box .score {
    font-family: 'Cairo', sans-serif;
    font-size: 2.8rem;
    font-weight: 900;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.result-box .score span {
    color: var(--primary-light);
    font-size: 3.5rem;
}

#resultMessage {
    font-size: 1.6rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
}

#reviewAnswers {
    margin-top: 3rem;
}

.review-item {
    background: var(--card-bg);
    padding: 2rem;
    margin-bottom: 1.5rem;
    border-radius: 15px;
    border-right: 6px solid var(--light-bg);
    box-shadow: var(--shadow-sm);
}

.review-item.correct {
    border-right-color: var(--success-color);
}

.review-item.incorrect {
    border-right-color: var(--accent-color);
}

/* About Section */
.about-content {
    max-width: 900px;
    margin: 0 auto;
}

.about-card {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.05), rgba(41, 128, 185, 0.05));
    border: 2px solid var(--secondary-color);
}

.credits {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

.credit-item {
    text-align: center;
    padding: 2.5rem;
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border: 2px solid rgba(102, 126, 234, 0.1);
}

.credit-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(102, 126, 234, 0.3);
}

.credit-item h4 {
    font-family: 'Cairo', sans-serif;
    color: var(--secondary-color);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.credit-item .name {
    font-family: 'Cairo', sans-serif;
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--primary-color);
    margin-bottom: 0.8rem;
}

.credit-item .school {
    color: var(--medium-text);
    font-size: 1.05rem;
    font-weight: 500;
}

/* Footer */
footer {
    background: var(--gradient-primary);
    color: var(--white);
    text-align: center;
    padding: 3rem 0;
    margin-top: 4rem;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>');
    opacity: 0.2;
}

footer p {
    position: relative;
    z-index: 1;
    font-size: 1.1rem;
}

.footer-credits {
    margin-top: 1rem;
    opacity: 0.9;
    font-size: 1rem;
    position: relative;
    z-index: 1;
}

/* Source Information */
.source-info {
    margin-top: 1rem;
}

.source-info h4 {
    font-family: 'Cairo', sans-serif;
    color: var(--primary-color);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
}

.source-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08), rgba(0, 137, 123, 0.08));
    padding: 2rem;
    border-radius: 15px;
    border-right: 5px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.source-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(-5px);
}

.source-card p {
    margin-bottom: 0.8rem;
    line-height: 1.8;
    font-size: 1.05rem;
}

.source-card strong {
    color: var(--primary-color);
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
}

/* Solution Box */
.solution {
    background: var(--light-bg);
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
    border-right: 4px solid var(--secondary-color);
}

.solution h4 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.solution p {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.example-box {
    background: rgba(52, 152, 219, 0.1);
    padding: 1rem;
    border-radius: 5px;
    margin-top: 1rem;
    border-right: 3px solid var(--secondary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Mobile Menu Toggle */
    .mobile-menu-toggle {
        display: flex;
    }

    /* Hide menu by default on mobile */
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--white);
        flex-direction: column;
        align-items: stretch;
        padding: 80px 0 20px 0;
        box-shadow: -5px 0 25px rgba(0,0,0,0.2);
        transition: right 0.3s ease;
        overflow-y: auto;
        z-index: 999;
    }

    /* Show menu when active */
    .nav-menu.active {
        right: 0;
    }

    /* Overlay when menu is open */
    .main-nav::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 998;
    }

    .main-nav.menu-open::before {
        opacity: 1;
        visibility: visible;
    }

    .main-nav li {
        width: 100%;
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }

    .main-nav a {
        padding: 1.2rem 1.5rem;
        border-bottom: none;
        border-right: 4px solid transparent;
        text-align: right;
    }

    .main-nav a::after {
        display: none;
    }

    .main-nav a:hover,
    .main-nav a.active {
        border-right-color: var(--primary-color);
        background: rgba(102, 126, 234, 0.08);
    }

    header h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    .hero-content h2 {
        font-size: 1.8rem;
        text-align: center;
    }

    .hero-content p {
        font-size: 1.1rem;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .section h2 {
        font-size: 1.8rem;
    }

    canvas {
        max-width: 100%;
        height: auto;
        width: 100% !important;
    }

    #forceCanvas,
    #bookCanvas,
    #accelerationCanvas,
    #swimmingCanvas,
    #tensionCanvas,
    #frictionCanvas,
    #ropeCanvas {
        max-width: 100%;
        height: auto;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .controls label {
        width: 100%;
        justify-content: space-between;
    }

    .controls input[type="range"] {
        width: 100%;
        max-width: 100%;
    }

    .controls button {
        width: 100%;
        margin: 0.5rem 0;
    }

    .credits {
        grid-template-columns: 1fr;
    }

    .law-box {
        padding: 1.5rem;
    }

    .formula {
        font-size: 1.5rem;
    }

    .calculator {
        padding: 0;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        margin: 0.5rem 0;
    }

    .demo-info {
        font-size: 0.9rem;
    }

    .answer-option {
        padding: 0.8rem 1rem;
        font-size: 1rem;
    }

    .question-card h3 {
        font-size: 1.2rem;
    }

    #questionText {
        font-size: 1.1rem;
    }
}

/* Extra small devices (phones in portrait) */
@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }

    .hero-content h2 {
        font-size: 1.5rem;
    }

    .section h2 {
        font-size: 1.5rem;
    }

    .card {
        padding: 1.5rem;
    }

    .law-box {
        padding: 1rem;
    }

    .law-box h3 {
        font-size: 1.3rem;
    }

    .formula {
        font-size: 1.3rem;
        padding: 1rem;
    }

    .controls {
        padding: 1rem;
    }

    .newton-balls {
        transform: scale(0.8);
    }
}/* Animations */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--light-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}
