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

:root {
    --primary: #0B0B0C;
    --secondary: #111216;
    --gold: #D4AF37;
    --gold-soft: #C9A368;
    --text-gray: #CECECE;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--primary);
    color: white;
    min-height: 100vh;
    padding: 20px;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Particle Background */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.3;
}

.container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

h1 {
    text-align: center;
    color: white;
    font-size: 3rem;
    margin-bottom: 10px;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
}

.subtitle {
    text-align: center;
    color: var(--text-gray);
    font-size: 1.2rem;
    margin-bottom: 50px;
    font-weight: 300;
}

.exercises-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.exercise-card {
    background: rgba(17, 18, 22, 0.8);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 15px;
    padding: 30px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.exercise-card:hover {
    transform: translateY(-5px);
    border-color: var(--gold);
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.3);
}

.exercise-card h2 {
    background: linear-gradient(135deg, var(--gold), var(--gold-soft));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    font-size: 1.8rem;
    font-weight: 700;
}

.exercise-card p {
    color: var(--text-gray);
    margin-bottom: 20px;
    line-height: 1.6;
}

button {
    width: 100%;
    padding: 15px;
    background: var(--gold);
    color: var(--primary);
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

button:hover {
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.5);
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

/* Exercise Pages */
.exercise {
    background: rgba(17, 18, 22, 0.8);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

.exercise h2 {
    color: var(--gold);
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.exercise p {
    color: var(--text-gray);
    margin-bottom: 15px;
    line-height: 1.6;
}

.exercise ul {
    color: var(--text-gray);
    margin-left: 30px;
    margin-bottom: 15px;
}

.exercise ul li {
    margin-bottom: 8px;
}

.result {
    margin-top: 20px;
    padding: 20px;
    background: rgba(11, 11, 12, 0.6);
    border-radius: 10px;
    border: 1px solid rgba(212, 175, 55, 0.1);
}

.result p {
    margin-bottom: 10px;
}

.result strong {
    color: var(--gold);
}

.success {
    color: #4ade80;
    font-weight: 600;
}

.info {
    color: #60a5fa;
    font-style: italic;
}

.back-link {
    display: inline-block;
    margin-top: 30px;
    padding: 12px 24px;
    background: rgba(17, 18, 22, 0.8);
    color: var(--gold);
    text-decoration: none;
    border-radius: 10px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    transition: all 0.3s ease;
}

.back-link:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--gold);
}

/* Code Examples */
.code-example {
    background: rgba(11, 11, 12, 0.8);
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.code-example h3 {
    color: var(--gold);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

pre {
    background: rgba(0, 0, 0, 0.4);
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 10px 0;
}

code {
    font-family: 'Courier New', monospace;
    color: #e0e0e0;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Console Output */
.console-output {
    background: rgba(0, 0, 0, 0.6);
    padding: 15px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    color: #4ade80;
    margin: 15px 0;
}

.console-output div {
    margin-bottom: 5px;
}

/* Info Box */
.info-box {
    background: rgba(96, 165, 250, 0.1);
    border: 1px solid rgba(96, 165, 250, 0.3);
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.info-box h4 {
    color: #60a5fa;
    margin-bottom: 10px;
}

.info-box ul {
    list-style: none;
    margin-left: 0;
}

.info-box li {
    color: var(--text-gray);
    margin-bottom: 8px;
}

/* Result Sections */
.result-section {
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(17, 18, 22, 0.6);
    border-radius: 10px;
    border: 1px solid rgba(212, 175, 55, 0.1);
}

.result-section h3 {
    color: var(--gold);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.family-output p,
.books-output p {
    margin-bottom: 10px;
    color: var(--text-gray);
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

table th {
    background: rgba(212, 175, 55, 0.2);
    color: var(--gold);
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

table td {
    padding: 12px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
    color: var(--text-gray);
}

table tr:hover {
    background: rgba(212, 175, 55, 0.05);
}

table tr.highlight {
    background: rgba(74, 222, 128, 0.1);
    border-left: 3px solid #4ade80;
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    .exercises-grid {
        grid-template-columns: 1fr;
    }
    
    .exercise {
        padding: 20px;
    }
    
    table {
        font-size: 0.9rem;
    }
    
    table th,
    table td {
        padding: 8px;
    }
}
