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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #212529;
    background-color: #f8f9fa;
}

/* Left Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background-color: #ffffff;
    border-right: 1px solid #dee2e6;
    overflow-y: auto;
    z-index: 1000;
}

.logo-area {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid #dee2e6;
    text-align: center;
}

.logo {
    width: 100%;
    max-width: 240px;
    height: auto;
    margin-bottom: 1rem;
}

.website-link {
    display: block;
    color: #0D6EFD;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.website-link:hover {
    text-decoration: underline;
}

.nav-menu {
    list-style: none;
    padding: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 1.5rem 1.5rem;
    height: 80px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-left: 4px solid transparent;
}

.nav-item:hover {
    background-color: #f8f9fa;
}

.nav-item.active {
    background-color: #e7f1ff;
    border-left-color: #0D6EFD;
}

.nav-item i {
    width: 24px;
    height: 24px;
    color: #0D6EFD;
    margin-right: 1rem;
    flex-shrink: 0;
}

.nav-item span {
    font-size: 0.95rem;
    font-weight: 500;
    color: #212529;
}

/* Right Content Area */
.content-area {
    margin-left: 280px;
    min-height: 100vh;
    background-color: #ffffff;
}

.content-wrapper {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 3rem 3rem;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #0D6EFD 0%, #5DADE2 100%);
    border-radius: 16px;
    padding: 60px 50px;
    margin-bottom: 3rem;
    color: #ffffff;
}

.version-tag {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.hero-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #ffffff;
}

.hero-section .subtitle {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.btn-primary {
    background-color: #ffffff;
    color: #0D6EFD;
}

.btn-primary:hover {
    background-color: #f8f9fa;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: #ffffff;
    border-color: #ffffff;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Chapter Navigation Cards */
.chapter-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 3rem;
}

.chapter-card {
    background-color: #0D6EFD;
    border-radius: 12px;
    padding: 1.5rem;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    color: #ffffff;
}

.chapter-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(13, 110, 253, 0.3);
}

.chapter-card-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.chapter-card i {
    width: 32px;
    height: 32px;
    color: #ffffff;
}

.chapter-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
}

.chapter-badge {
    background-color: #198754;
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* Content Sections */
.section {
    margin-bottom: 3rem;
}

.section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #0D6EFD;
}

.section h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #212529;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.section h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #495057;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.section p {
    margin-bottom: 1rem;
    line-height: 1.8;
    text-align: justify;
}

.section ul, .section ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.section li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* Images and Figures */
.figure {
    margin: 2rem 0;
    text-align: center;
}

.figure img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.figure-caption {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: #6c757d;
    font-style: italic;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

thead {
    background-color: #0D6EFD;
    color: #ffffff;
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
}

td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #dee2e6;
}

tbody tr:hover {
    background-color: #f8f9fa;
}

/* Calculator Styles */
.calculator-container {
    background-color: #f8f9fa;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.calculator-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0D6EFD;
    margin-bottom: 1.5rem;
}

.calculator-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.input-group, .output-group {
    margin-bottom: 1.5rem;
}

.input-group label, .output-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #495057;
}

.input-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: #0D6EFD;
}

.output-group .output-value {
    display: block;
    padding: 0.75rem;
    background-color: #e7f1ff;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #0D6EFD;
}

.calculate-btn {
    width: 100%;
    padding: 1rem;
    background-color: #0D6EFD;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.calculate-btn:hover {
    background-color: #0b5ed7;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .content-area {
        margin-left: 0;
    }
    
    .chapter-grid {
        grid-template-columns: 1fr;
    }
    
    .calculator-grid {
        grid-template-columns: 1fr;
    }
}
