body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    color: #333;
    background-color: #f9f9f9;
}

.container {
    width: 90%;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.main-header {
    background: #2c3e50;
    color: #fff;
    padding: 1rem 0;
    text-align: center;
}

.main-header h1 {
    margin: 0;
    font-size: 1.8rem;
}

.main-header a {
    color: #fff;
    text-decoration: none;
}

/* Index - Chapter List */
.chapter-list-container {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.chapter-list {
    list-style: none;
    padding: 0;
    columns: 2; /* 2 column layout */
}

.chapter-list li {
    margin-bottom: 10px;
}

.chapter-list a {
    text-decoration: none;
    color: #2980b9;
    font-weight: 500;
    display: block;
    padding: 5px;
    border-radius: 4px;
}

.chapter-list a:hover {
    background: #f0f0f0;
}

.chap-num {
    display: inline-block;
    width: 30px;
    color: #7f8c8d;
    font-size: 0.9em;
}

/* Chapter Page - Kural List */
.chapter-page h2 {
    color: #2c3e50;
    border-bottom: 2px solid #e74c3c;
    padding-bottom: 10px;
}

.kural-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.kural-card-link {
    text-decoration: none;
    color: inherit;
}

.kural-card {
    background: #fff;
    padding: 15px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s;
    border-left: 4px solid #3498db;
    display: flex;
    align-items: center;
    gap: 15px;
}

.kural-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.kural-num {
    font-weight: bold;
    color: #3498db;
    font-size: 1.2rem;
    min-width: 40px;
}

.kural-text-preview {
    margin: 0;
    color: #2c3e50;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Kural Detail Page */
.kural-detail {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.kural-header-section h1 {
    font-size: 1.4rem;
    color: #2c3e50;
    line-height: 1.8;
    margin-top: 0;
    text-align: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}

/* Scraped HTML content styles */
.explanations {
    margin-top: 20px;
}
.explanations table {
    width: 100%;
    border-collapse: collapse;
}
.explanations td {
    padding: 10px;
    vertical-align: top;
}
/* User styles preservation */
.explanations b {
    color: #d35400; /* Custom style mimicking source */
}

/* Image */
.kural-image {
    margin-top: 30px;
    text-align: center;
}

.kural-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid #ddd;
}

/* Navigation */
.nav-buttons {
    margin-top: 30px;
    display: flex;
    justify-content: space-between;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background: #f4f4f4;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.btn:hover {
    background: #e0e0e0;
}

@media (max-width: 600px) {
    .chapter-list { columns: 1; }
    .nav-buttons { flex-direction: column; gap: 10px; text-align: center; }
    .btn { display: block; width: 100%; box-sizing: border-box; }
}
