/* ===========================
   CSS RESET & VARIABLES
   =========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border-color: #334155;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-purple: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

/* ===========================
   GLOBAL STYLES
   =========================== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* ===========================
   ANIMATED STARFIELD BACKGROUND
   =========================== */
.stars, .stars2, .stars3 {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.stars {
    background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQYV2NgYGD4DwABBAEAW9JXPAAAAABJRU5ErkJggg==') repeat;
    animation: stars-move 50s linear infinite;
    opacity: 0.7;
}

.stars2 {
    background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQYV2NgYGD4DwABBAEAW9JXPAAAAABJRU5ErkJggg==') repeat;
    animation: stars-move 100s linear infinite;
    opacity: 0.5;
}

.stars3 {
    background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQYV2NgYGD4DwABBAEAW9JXPAAAAABJRU5ErkJggg==') repeat;
    animation: stars-move 150s linear infinite;
    opacity: 0.3;
}

/* Custom starfield pattern using radial gradients */
.stars {
    background-image: 
        radial-gradient(2px 2px at 20% 30%, white, transparent),
        radial-gradient(2px 2px at 60% 70%, white, transparent),
        radial-gradient(1px 1px at 50% 50%, white, transparent),
        radial-gradient(1px 1px at 80% 10%, white, transparent),
        radial-gradient(2px 2px at 90% 60%, white, transparent),
        radial-gradient(1px 1px at 33% 80%, white, transparent);
    background-size: 200px 200px, 300px 300px, 250px 250px, 350px 350px, 280px 280px, 320px 320px;
}

.stars2 {
    background-image: 
        radial-gradient(1px 1px at 10% 20%, #6366f1, transparent),
        radial-gradient(1px 1px at 70% 80%, #8b5cf6, transparent),
        radial-gradient(1px 1px at 40% 40%, #ec4899, transparent);
    background-size: 400px 400px, 500px 500px, 450px 450px;
}

.stars3 {
    background-image: 
        radial-gradient(1px 1px at 25% 60%, rgba(99, 102, 241, 0.5), transparent),
        radial-gradient(2px 2px at 85% 15%, rgba(139, 92, 246, 0.5), transparent);
    background-size: 600px 600px, 700px 700px;
}

@keyframes stars-move {
    from { transform: translateY(0); }
    to { transform: translateY(-1000px); }
}

/* ===========================
   CONTAINER & LAYOUT
   =========================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

/* ===========================
   HEADERS
   =========================== */
.main-header {
    text-align: center;
    margin-bottom: 4rem;
    padding: 3rem 0;
}

.main-header h1 {
    font-size: 4rem;
    font-weight: 800;
    background: var(--gradient-purple);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    text-shadow: 0 0 30px rgba(99, 102, 241, 0.5);
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.page-header h1 {
    font-size: 3rem;
    font-weight: 700;
    background: var(--gradient-purple);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 300;
}

/* ===========================
   NAVIGATION
   =========================== */
.breadcrumb {
    margin-bottom: 2rem;
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumb a:hover {
    color: var(--primary-color);
    transform: translateX(-5px);
}

.bottom-nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.nav-btn {
    flex: 1;
    padding: 1rem 2rem;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    text-decoration: none;
    text-align: center;
    font-weight: 600;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* ===========================
   TOPIC GRID (INDEX PAGE)
   =========================== */
.topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.topic-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 3rem 2rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.topic-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-purple);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
}

.topic-card:hover::before {
    opacity: 0.1;
}

.topic-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-glow);
}

.topic-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.topic-card h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.topic-card p {
    color: var(--text-secondary);
    position: relative;
    z-index: 1;
    margin-bottom: 1rem;
}

.card-arrow {
    font-size: 2rem;
    margin-top: 1rem;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1;
}

.topic-card:hover .card-arrow {
    transform: translateX(10px);
}

/* ===========================
   CONTENT SECTIONS
   =========================== */
.content-section {
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--primary-color);
    background: var(--gradient-purple);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===========================
   CARDS
   =========================== */
.card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-purple);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card:hover::before {
    opacity: 1;
}

.card.experiment {
    border-left: 4px solid var(--accent-color);
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-content {
    color: var(--text-secondary);
}

/* ===========================
   THEORY POINTS & DETAILS
   =========================== */
.theory-points, .experiment-details {
    margin-bottom: 1.5rem;
}

.point, .detail {
    background: rgba(99, 102, 241, 0.1);
    border-left: 3px solid var(--primary-color);
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.point:hover, .detail:hover {
    background: rgba(99, 102, 241, 0.15);
    transform: translateX(5px);
}

.point strong, .detail strong {
    color: var(--primary-color);
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
}

/* ===========================
   TOGGLE BUTTONS
   =========================== */
.toggle-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    background: var(--gradient-purple);
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-md);
}

.toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
}

.toggle-btn .arrow {
    transition: transform 0.3s ease;
    font-size: 1.2rem;
}

/* ===========================
   PROS & CONS SECTIONS
   =========================== */
.pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid var(--border-color);
    overflow: hidden;
    max-height: 2000px;
    transition: all 0.5s ease;
}

.pros-cons.hidden {
    max-height: 0;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    opacity: 0;
}

.pros, .cons {
    padding: 1.5rem;
    border-radius: 12px;
    transition: transform 0.3s ease;
}

.pros {
    background: rgba(16, 185, 129, 0.1);
    border: 2px solid rgba(16, 185, 129, 0.3);
}

.cons {
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid rgba(239, 68, 68, 0.3);
}

.pros:hover, .cons:hover {
    transform: scale(1.02);
}

.pros h4 {
    color: var(--success);
    font-size: 1.2rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cons h4 {
    color: var(--danger);
    font-size: 1.2rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pros ul, .cons ul {
    list-style: none;
    padding-left: 0;
}

.pros li, .cons li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.6;
}

.pros li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: bold;
}

.cons li::before {
    content: '✗';
    position: absolute;
    left: 0;
    color: var(--danger);
    font-weight: bold;
}

/* ===========================
   FOOTER
   =========================== */
.main-footer {
    text-align: center;
    margin-top: 4rem;
    padding: 2rem 0;
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* ===========================
   ANIMATIONS
   =========================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.8s ease-out;
}

.fade-in-delay {
    animation: fadeIn 0.8s ease-out 0.2s backwards;
}

.slide-up {
    animation: slideUp 0.6s ease-out;
}

.slide-up-delay {
    animation: slideUp 0.6s ease-out 0.2s backwards;
}

/* ===========================
   RESPONSIVE DESIGN
   =========================== */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .main-header h1 {
        font-size: 2.5rem;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .topic-grid {
        grid-template-columns: 1fr;
    }

    .pros-cons {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .card-title {
        font-size: 1.2rem;
    }

    .bottom-nav {
        flex-direction: column;
    }

    .topic-card h2 {
        font-size: 1.5rem;
    }
}

/* ===========================
   UTILITY CLASSES
   =========================== */
.hidden {
    display: none;
}

/* ===========================
   SCROLLBAR STYLING
   =========================== */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* ===========================
   SELECTION STYLING
   =========================== */
::selection {
    background: var(--primary-color);
    color: white;
}

::-moz-selection {
    background: var(--primary-color);
    color: white;
}

/* ===========================
   HOVER EFFECTS & INTERACTIONS
   =========================== */
a {
    transition: all 0.3s ease;
}

button {
    font-family: inherit;
}

/* ===========================
   PRINT STYLES
   =========================== */
@media print {
    .stars, .stars2, .stars3 {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    .card {
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }

    .pros-cons.hidden {
        display: grid !important;
        max-height: none !important;
        opacity: 1 !important;
    }
}
