/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #00ADD8;
    --secondary-color: #5DC9E2;
    --accent-color: #CE3262;
    --dark-bg: #1a1a2e;
    --light-bg: #f8f9fa;
    --text-dark: #2c3e50;
    --text-light: #6c757d;
    --code-bg: #f4f4f4;
    --border-color: #e1e4e8;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--light-bg);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin-top: 1.5em;
    margin-bottom: 0.75em;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-dark);
}

h1 {
    font-size: 2.5rem;
    margin-top: 0;
}

h2 {
    font-size: 2rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.3em;
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1em;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar */
.navbar {
    background-color: var(--dark-bg);
    padding: 1rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.nav-home {
    font-size: 1.25rem;
    font-weight: 600;
    color: white !important;
    text-decoration: none !important;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: white !important;
    text-decoration: none !important;
    transition: opacity 0.2s;
}

.nav-links a:hover {
    opacity: 0.8;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 3rem 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-radius: 12px;
    margin: 2rem 0;
    box-shadow: var(--shadow);
}

.hero h1 {
    color: white;
    margin-bottom: 1rem;
}

.hero .lead {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    opacity: 0.95;
}

.hero .version-note {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 1rem;
    border-radius: 8px;
    display: inline-block;
    margin-top: 1rem;
}

/* Sections */
section {
    background: white;
    padding: 2rem;
    margin: 2rem 0;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

section h2:first-child {
    margin-top: 0;
}

/* Exercise Grid */
.exercises-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.exercise-card-link {
    text-decoration: none !important;
    color: inherit;
    display: block;
}

.exercise-card-link:hover {
    text-decoration: none !important;
}

.exercise-card {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s;
    background: white;
    height: 100%;
}

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

.exercise-number {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.exercise-card h3 {
    margin: 0.5rem 0;
    font-size: 1.25rem;
    color: var(--text-dark);
}

.exercise-card-link:hover .exercise-card h3 {
    color: var(--primary-color);
}

.exercise-card p {
    margin: 0.5rem 0 0 0;
    color: var(--text-light);
}

/* Code Blocks */
pre {
    background: #282c34 !important;
    border: 2px solid #00ADD8;
    border-radius: 12px;
    padding: 1.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    line-height: 1.6;
    box-shadow: 0 8px 20px rgba(0, 173, 216, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
}

pre::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #00ADD8, #5DC9E2, #CE3262);
    border-radius: 12px 12px 0 0;
}

code {
    font-family: 'Fira Code', 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 0.95em;
    background-color: rgba(0, 173, 216, 0.1);
    color: #00ADD8;
    padding: 0.2em 0.5em;
    border-radius: 4px;
    border: 1px solid rgba(0, 173, 216, 0.3);
}

pre code {
    background-color: transparent;
    padding: 0;
    border: none;
    color: #e8e8e8;
    display: block;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Copy Button */
.copy-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: rgba(0, 173, 216, 0.2);
    border: 1px solid rgba(0, 173, 216, 0.5);
    color: #00ADD8;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 10;
}

.copy-button:hover {
    background-color: rgba(0, 173, 216, 0.3);
    border-color: #00ADD8;
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(0, 173, 216, 0.5);
}

.copy-button.copied {
    background-color: rgba(46, 213, 115, 0.3);
    border-color: #2ed573;
    color: #2ed573;
}

/* Lists */
ul, ol {
    margin: 1rem 0 1rem 2rem;
}

li {
    margin: 0.5rem 0;
}

/* Exercise Content */
.exercise-content {
    background: white;
    padding: 3rem;
    margin: 2rem 0;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.exercise-content h1:first-child {
    margin-top: 0;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--primary-color);
}

/* Exercise Navigation */
.exercise-nav {
    display: flex;
    justify-content: space-between;
    margin: 2rem 0;
    gap: 1rem;
}

.nav-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white !important;
    text-decoration: none !important;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: var(--shadow);
}

.nav-button:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* CTA Button */
.cta {
    text-align: center;
    margin: 3rem 0;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white !important;
    text-decoration: none !important;
    border-radius: 8px;
    font-size: 1.25rem;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: var(--shadow);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Footer */
footer {
    background-color: var(--dark-bg);
    color: white;
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
}

footer p {
    margin: 0.5rem 0;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: white !important;
    text-decoration: none !important;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-links a:hover {
    color: var(--primary-color) !important;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: white;
    box-shadow: var(--shadow);
    border-radius: 8px;
    overflow: hidden;
}

table th,
table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

table tr:last-child td {
    border-bottom: none;
}

table tr:hover {
    background-color: var(--light-bg);
}

/* Blockquotes */
blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background-color: var(--light-bg);
    border-radius: 0 8px 8px 0;
}

/* Strong/Bold emphasis */
strong {
    color: var(--text-dark);
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .exercises-grid {
        grid-template-columns: 1fr;
    }

    .exercise-content {
        padding: 1.5rem;
    }

    .exercise-nav {
        flex-direction: column;
    }

    .nav-button {
        text-align: center;
    }

    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.video-container {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: var(--shadow);
}

.video-container h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.video-container iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.video-container p {
    margin: 0;
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-1 {
    margin-bottom: 1rem;
}

.mb-2 {
    margin-bottom: 2rem;
}

.mt-1 {
    margin-top: 1rem;
}

.mt-2 {
    margin-top: 2rem;
}
