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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #212529;
    background-color: #FFFFFF;
}

/* Left Sidebar Navigation - STRICTLY FIXED */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 250px;
    height: 100vh;
    background-color: #F8F9FA;
    border-right: 1px solid #DEE2E6;
    overflow-y: auto;
    z-index: 1000;
}

/* Logo Container */
.logo-container {
    padding: 1.5rem;
    text-align: center;
    background-color: #FFFFFF;
    border-bottom: 1px solid #DEE2E6;
}

.logo {
    max-width: 200px;
    height: auto;
    display: block;
    margin: 0 auto 0.75rem;
}

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

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

/* Navigation Menu */
.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    height: 80px; /* STRICTLY 80px - NO DEVIATION ALLOWED */
    width: 100%;
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    border-left: 4px solid transparent;
}

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

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

.file-icon {
    margin-right: 0.75rem;
    font-size: 1rem;
}

.nav-item a {
    color: #212529;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 400;
    flex: 1;
}

/* Main Content Area */
.main-content {
    margin-left: 250px;
    min-height: 100vh;
    background-color: #FFFFFF;
}

/* Hero Section - STRICTLY ENFORCED DIMENSIONS */
.hero {
    background: linear-gradient(135deg, #0D6EFD 0%, #5DADE2 100%);
    border-radius: 1rem; /* STRICTLY ROUNDED CORNERS */
    padding: 60px 50px;
    margin: 40px 40px 40px 40px;
    max-width: 1000px; /* STRICTLY 1000px */
    height: 340px; /* STRICTLY 320-360px range */
    display: flex;
    align-items: center;
}

/* Hero Section for Chapter Pages */
.hero-chapter {
    background: linear-gradient(135deg, #0D6EFD 0%, #5DADE2 100%);
    border-radius: 1rem;
    padding: 40px 50px;
    margin: 40px 40px 40px 40px;
    max-width: 1000px;
    min-height: 200px;
    display: flex;
    align-items: center;
}

.hero-content {
    max-width: 100%;
}

.version-badge {
    display: inline-block;
    background-color: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.hero-title {
    font-size: 2.5rem; /* 40px */
    font-weight: 700;
    color: #FFFFFF; /* STRICTLY WHITE TEXT */
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1rem;
    color: #FFFFFF;
    margin-bottom: 2rem;
    line-height: 1.6;
}

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

.btn {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
    border: none;
}

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

.btn-primary:hover {
    background-color: #F8F9FA;
    transform: scale(1.05);
}

.btn-secondary {
    background-color: transparent;
    color: #FFFFFF;
    border: 2px solid #FFFFFF;
}

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

/* Content Section */
.content-section {
    padding: 2rem 50px;
    max-width: 1000px;
    margin: 0; /* LEFT ALIGNED - NO AUTO CENTERING */
    margin-top: 40px; /* Top spacing for chapter pages */
}

.content-section h2 {
    font-size: 2rem; /* 32px */
    font-weight: 700;
    color: #0D6EFD;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #DEE2E6;
}

.content-section h3 {
    font-size: 1.5rem; /* 24px */
    font-weight: 600;
    color: #0D6EFD;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.content-section h4 {
    font-size: 1.25rem; /* 20px */
    font-weight: 600;
    color: #0D6EFD;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.content-section p {
    font-size: 1rem;
    color: #212529;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.content-section ul,
.content-section ol {
    margin-left: 2rem;
    margin-bottom: 1.5rem;
}

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

/* Image Container */
.image-container {
    margin: 2rem 0;
}

.content-image {
    width: 100%;
    height: auto;
    border-radius: 0.5rem;
    border: 1px solid #DEE2E6;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.image-caption {
    font-size: 0.875rem;
    color: #6C757D;
    text-align: center;
    margin-top: 0.5rem;
    font-style: italic;
}

/* Chapter Cards Section - STRICTLY ENFORCED */
.chapter-cards-section {
    background-color: #F8F9FA; /* STRICTLY UNIFORM BACKGROUND */
    padding: 40px;
    margin: 40px 40px;
    max-width: 1000px; /* STRICTLY 1000px */
}

.chapter-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px; /* STRICTLY 20px */
    width: 100%;
}

/* Individual Chapter Card - STRICTLY ENFORCED */
.chapter-card {
    height: 130px; /* STRICTLY 130px - NO DEVIATION */
    background-color: #FFFFFF;
    border: 2px dashed #198754;
    border-radius: 0.5rem;
    padding: 15px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    position: relative;
    transition: all 0.3s;
}

.chapter-card:hover {
    background-color: #F8F9FA;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
}

.card-icon {
    font-size: 40px;
    color: #0D6EFD;
}

.card-number {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: #198754;
    color: #FFFFFF;
    font-size: 0.75rem;
    font-weight: 700;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #212529;
    margin: 0;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background-color: #FFFFFF;
    border: 1px solid #DEE2E6;
}

thead {
    background-color: #F8F9FA;
}

th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 700;
    color: #212529;
    border: 1px solid #DEE2E6;
}

td {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    color: #212529;
    border: 1px solid #DEE2E6;
}

tr:nth-child(even) {
    background-color: #F8F9FA;
}

/* Calculator Styles */
.calculator-container {
    background-color: #F8F9FA;
    border: 1px solid #DEE2E6;
    border-radius: 0.5rem;
    padding: 2rem;
    margin: 2rem 0;
}

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

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    border: 1px solid #DEE2E6;
    border-radius: 0.375rem;
    background-color: #FFFFFF;
}

.form-input:focus {
    outline: none;
    border-color: #0D6EFD;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.calculate-btn {
    background-color: #0D6EFD;
    color: #FFFFFF;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.calculate-btn:hover {
    background-color: #0b5ed7;
    transform: scale(1.05);
}

.result-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: #FFFFFF;
    border: 1px solid #DEE2E6;
    border-radius: 0.5rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #DEE2E6;
}

.result-item:last-child {
    border-bottom: none;
}

.result-label {
    font-weight: 600;
    color: #212529;
}

.result-value {
    font-weight: 700;
    color: #0D6EFD;
    font-size: 1.125rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .chapter-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .hero {
        height: auto;
        padding: 40px 30px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
}
