:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #64748b;
    --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    --card-bg: rgba(255, 255, 255, 0.8);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-gradient);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 4rem;
    padding-top: 2rem;
}

header h1 {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
}

header p {
    font-size: 1.25rem;
    color: var(--text-muted);
}

.hero-image {
    max-width: 600px;
    margin: 0 auto 3rem;
    display: block;
    border-radius: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.hero-image:hover {
    transform: translateY(-5px);
}

.index-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 20px 25px -5px rgba(37, 99, 235, 0.1), 0 10px 10px -5px rgba(37, 99, 235, 0.1);
}

.card h2 {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.card ul {
    list-style: none;
    padding-left: 0;
}

.card li {
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
    font-size: 0.95rem;
    color: var(--secondary);
}

.card li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--primary);
}

/* Manual Page Styles */
.manual-content {
    background: white;
    padding: 3rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden; /* Ensure floats are cleared */
}

.manual-content h1 {
    color: var(--primary-dark);
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0.5rem;
}

.manual-content h2 {
    color: var(--primary);
    margin: 2.5rem 0 1.5rem;
    clear: both;
}

.manual-content p {
    margin-bottom: 1.5rem;
    clear: both; /* Prevent text wrapping around images */
}

.manual-content img {
    display: block !important;
    margin: 3rem auto !important;
    max-width: 90% !important;
    height: auto !important;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -6px rgba(0, 0, 0, 0.1);
    clear: both;
}

.footer-nav {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}

.btn-index {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.2s ease;
}

.btn-index:hover {
    background: var(--primary-dark);
}

.btn-index::before {
    content: "🏠";
    margin-right: 0.5rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    margin-bottom: 2rem;
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
}

.back-link::before {
    content: "←";
    margin-right: 0.5rem;
}

footer {
    text-align: center;
    padding: 4rem 0 2rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Pandoc specific */
blockquote {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
    padding: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    border-radius: 0 8px 8px 0;
}

/* Modal Styles */
.image-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(5px);
    cursor: zoom-out;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.image-modal img {
    max-width: 95%;
    max-height: 95%;
    border-radius: 8px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.image-modal.active img {
    transform: scale(1);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-modal:hover {
    color: var(--primary);
}

.manual-content img {
    cursor: zoom-in;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.manual-content img:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 25px 30px -5px rgba(0, 0, 0, 0.15);
}
