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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

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

header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

header h1 {
    font-size: 1.8rem;
}

nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

nav a.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.6rem 1.5rem;
    background-color: #3498db;
    border-radius: 4px;
    transition: background-color 0.3s;
}

nav a.nav-link:hover {
    background-color: #2980b9;
}

main {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

footer {
    background-color: #34495e;
    color: white;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 3rem;
}

.btn-primary, .btn-secondary {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.search-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.search-bar input {
    flex: 1;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.chapters-grid, .chapter-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .chapters-grid, .chapter-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .chapters-grid, .chapter-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

.chapter-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.chapter-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.chapter-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.chapter-card-content {
    padding: 1.5rem;
}

.chapter-card h3 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-size: 1.2rem;
}

.chapter-card p {
    color: #7f8c8d;
    margin-bottom: 1rem;
}

.chapter-card-description {
    font-size: 0.9rem;
    line-height: 1.5;
    min-height: 3rem;
}

.chapter-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #ecf0f1;
}

.chapter-card-price {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1rem;
}

.chapter-card-discount {
    background-color: #d4edda;
    color: #155724;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.chapter-card .leader {
    font-size: 0.9rem;
    color: #3498db;
}

.chapter-card .member-count {
    font-size: 0.9rem;
    color: #27ae60;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #7f8c8d;
}

.chapter-detail {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    margin-top: 1rem;
}

.chapter-header {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.chapter-header img {
    width: 300px;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
}

.chapter-info h2 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.chapter-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #ecf0f1;
}

.announcement {
    background: #ecf0f1;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.announcement h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.announcement .date {
    font-size: 0.85rem;
    color: #95a5a6;
}

.members-table {
    width: 100%;
    border-collapse: collapse;
}

.members-table th,
.members-table td {
    padding: 0.8rem;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.members-table th {
    background-color: #34495e;
    color: white;
}

.badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-active {
    background-color: #d4edda;
    color: #155724;
}

.badge-leader {
    background-color: #fff3cd;
    color: #856404;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

#dashboardLink {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
}

#dashboardLink:hover {
    text-decoration: underline;
}
