/* Reset and base styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-family: 'Arial', sans-serif;
    padding: 0;
    margin: 0;
}

/* Main container styling */
.page-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    font-family: 'Arial', sans-serif;
}

/* Main heading */
.page-container h1,h2 {
    color: #333;
    font-size: 2.5rem;
    font-weight: bold;
    text-align: center;
    margin: 20px 0 20px 0; /* 20px top and bottom */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Chapter container boxes */
.chapter {
    background-color: rgba(255, 255, 255, 0.95);
    margin: 0 auto 20px auto; /* no top margin, 20px bottom */
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    max-width: 800px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

/* Button styling for chapter boxes */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
    min-width: 100px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.view-btn {
    background-color: #2196F3;
    color: white;
    margin-right: 10px;
}

.view-btn:hover {
    background-color: #1976D2;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.download-btn {
    background-color: #4CAF50;
    color: white;
}

.download-btn:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Chapter text styling for coming soon */
.chapter:not(:has(.btn)) {
    color: #666;
    font-style: italic;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.7);
}

/* Go back link */
.goback {
    position: fixed;
    bottom: 20px;
    left: 20px;
    font-size: 16px;
    z-index: 1000;
}

.goback a {
    color: white;
    text-decoration: none;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 25px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.goback a:hover {
    color: #4CAF50;
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* Ensure chatbot stays on extreme right */
#chatbot-icon {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    z-index: 1001 !important;
}

/* Responsive design */
@media (max-width: 768px) {
    .page-container {
        padding: 15px;
    }
    
    .page-container h1 {
        font-size: 2rem;
        margin: 15px 0 20px 0; /* keep 20px bottom gap */
    }
    
    .chapter {
        flex-direction: column;
        text-align: center;
        padding: 20px;
        margin: 0 auto 20px auto;
    }
    
    .btn {
        margin: 5px;
        min-width: 120px;
    }
    
    .goback {
        font-size: 18px;
        bottom: 30px;
        left: 30px;
    }

    .goback a {
        padding: 12px 24px;
    }
    
    #chatbot-icon {
        bottom: 30px !important;
        right: 30px !important;
    }
}

@media (max-width: 480px) {
    .page-container {
        padding: 10px;
    }
    
    .page-container h1 {
        font-size: 1.8rem;
        margin: 10px 0 20px 0; /* keep 20px bottom gap */
    }
    
    .chapter {
        margin: 0 auto 20px auto;
        padding: 15px;
        font-size: 1rem;
    }
    
    .btn {
        font-size: 0.9rem;
        padding: 10px 20px;
    }
    
    .goback {
        font-size: 14px;
        bottom: 20px;
        left: 20px;
    }
    
    .goback a {
        padding: 8px 16px;
    }
}

@media (min-width: 769px) {
    .goback {
        font-size: 20px;
        bottom: 40px;
        left: 40px;
    }

    .goback a {
        padding: 15px 30px;
    }
    
    #chatbot-icon {
        bottom: 40px !important;
        right: 40px !important;
    }
}
