/* ========================================
   NPO E-Library - Main Stylesheet
   ======================================== */

/* ========================================
   Typography - Global Font
   ======================================== */

/* CSS Variable for reusable font */
:root {
    --primary-font: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    
    /* NPO E-Library Theme Colors */
    --primary-color: #6E8CFB;
    --primary-color-hover: #4b6ed8;
    --primary-color-rgb: 110, 140, 251;
    --primary-color-hover-rgb: 75, 110, 216;
    --primary-color-shadow: rgba(110, 140, 251, 0.4);
    --primary-color-shadow-hover: rgba(75, 110, 216, 0.6);
    --primary-color-shadow-active: rgba(110, 140, 251, 0.4);
    --primary-color-focus: rgba(110, 140, 251, 0.25);
    --primary-color-bg-light: rgba(110, 140, 251, 0.1);
    --primary-color-bg-lighter: rgba(110, 140, 251, 0.08);
}

/* Apply Open Sans globally - cascades to all child elements */
html,
body {
    font-family: var(--primary-font);
}

/* ========================================
   Common Styles
   ======================================== */

/* Body and Layout */
body {
    background-color: rgb(250, 250, 250);
}

.main-content {
    background-color: rgb(250, 250, 250);
}

.container {
    max-width: 1000px;
    margin: auto;
    padding: 30px;
    min-height: 100vh;

}
.footer-container {
    max-width: 1200px;
    margin: auto;
    padding: 30px;

}
/* ========================================
   User Dashboard Styles
   ======================================== */

.user-dashboard h2 {
    color: #2c3e50;
}

.user-dashboard #searchContainer {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.user-dashboard #searchInput {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px;
}

.user-dashboard button {
    padding: 8px 12px;
    font-size: 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.user-dashboard #searchBtn {
    background-color: #3498db;
    color: white;
}

.user-dashboard #resetBtn {
    background-color: rgb(7, 226, 233);
}

.user-dashboard .book, 
.user-dashboard .chapter, 
.user-dashboard .episode {
    margin: 10px 0;
    padding: 12px 15px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.user-dashboard .book {
    background-color: #ecf0f1;
    font-weight: bold;
    color: #2c3e50;
}

.user-dashboard .chapter {
    background-color: #d0f0f5;
    margin-left: 20px;
}

.user-dashboard .episode {
    background-color: #fff8e1;
    margin-left: 40px;
}

.user-dashboard .episode-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.user-dashboard .episode a {
    text-decoration: none;
    color: #007BFF;
    font-weight: bold;
    margin-right: 10px;
}

.user-dashboard .hidden {
    display: none;
}

.user-dashboard mark {
    background-color: yellow;
    font-weight: bold;
}

.user-dashboard .preview {
    margin-top: 8px;
    margin-left: 30px;
}

.user-dashboard .preview img {
    max-width: 200px;
    border: 1px solid #ccc;
}

.user-dashboard .preview-text {
    font-style: italic;
    color: #555;
}

/* ========================================
   Cart Page Styles
   ======================================== */

.cart-page table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.cart-page th, 
.cart-page td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.cart-page th {
    background-color: #34495e;
    color: white;
    font-weight: 600;
}

.cart-page tr:hover {
    background-color: #f8f9fa;
}

.cart-page .actions a {
    margin-right: 10px;
    text-decoration: none;
    color: #2980b9;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.cart-page .actions a:hover {
    background-color: #e3f2fd;
}

.cart-page .empty {
    text-align: center;
    margin-top: 50px;
    color: #888;
    font-size: 18px;
    padding: 40px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.cart-page .page-title {
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2rem;
    font-weight: 600;
}

/* ========================================
   Pay Episode Styles
   ======================================== */

.pay-episode {
    max-width: 500px;
    margin: 40px auto;
    padding: 0 20px;
}

.pay-episode label {
    display: block;
    margin-top: 20px;
}

.pay-episode input[type="file"], 
.pay-episode select, 
.pay-episode button {
    width: 100%;
    padding: 10px;
}

.pay-episode button {
    margin-top: 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
}

.pay-episode h2 {
    text-align: center;
}

.pay-episode p {
    margin: 10px 0;
}

/* ========================================
   Checkout Styles
   ======================================== */

.checkout-page {
    padding: 20px;
    margin: 0;
}

.checkout-page h2 {
    text-align: center;
    margin-bottom: 20px;
}

.checkout-page iframe {
    width: 100%;
    height: 90vh;
    border: none;
}

/* ========================================
   Registration Styles
   ======================================== */

/* Registration Step Styles */
.registration-step {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.registration-step.active {
    display: block;
}

/* OTP Input Styles */
.otp-input-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.otp-input {
    width: 50px;
    height: 50px;
    border: 2px solid #ddd;
    border-radius: 8px;
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    color: #333;
    background-color: #fff;
    transition: all 0.3s ease;
}

.otp-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

.otp-input.filled {
    border-color: #28a745;
    background-color: #f8fff9;
}

.otp-input.error {
    border-color: #dc3545;
    background-color: #fff5f5;
}

/* Form Styles */
.form-control {
    border-radius: 8px;
    border: 1px solid #ddd;
    padding: 12px 15px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.btn {
    border-radius: 8px;
    padding: 12px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    transform: translateY(-1px);
}

.btn-success {
    background-color: #28a745;
    border-color: #28a745;
}

.btn-success:hover {
    background-color: #1e7e34;
    border-color: #1e7e34;
    transform: translateY(-1px);
}

/* Alert Styles */
.alert {
    border-radius: 8px;
    border: none;
    padding: 12px 15px;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

/* Success Icon */
.fas.fa-check-circle {
    animation: bounceIn 0.6s ease;
}

/* ========================================
   Animations
   ======================================== */

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes bounceIn {
    0% { 
        transform: scale(0.3); 
        opacity: 0; 
    }
    50% { 
        transform: scale(1.05); 
    }
    70% { 
        transform: scale(0.9); 
    }
    100% { 
        transform: scale(1); 
        opacity: 1; 
    }
}

/* ========================================
   Utility Classes
   ======================================== */

.hidden {
    display: none;
}

.page-title {
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2rem;
    font-weight: 600;
}

/* ========================================
   Auth Pages Theme Styles (Login, Register, Forgot Password)
   ======================================== */

/* Theme Button Styles */
.login-btn-theme,
.register-btn-theme,
.forgot-btn-theme {
    background-color: var(--primary-color);
    border: 2px solid var(--primary-color);
    color: #ffffff !important;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px var(--primary-color-shadow);
}

.login-btn-theme:hover,
.register-btn-theme:hover,
.forgot-btn-theme:hover {
    background-color: var(--primary-color-hover);
    border-color: var(--primary-color-hover);
    box-shadow: 0 6px 16px var(--primary-color-shadow-hover);
    transform: translateY(-2px);
    color: #ffffff !important;
}

.login-btn-theme:active,
.register-btn-theme:active,
.forgot-btn-theme:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px var(--primary-color-shadow-active);
}

.forgot-btn-theme:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Theme Link Styles */
.register-link-theme,
.forgot-link-theme {
    color: var(--primary-color) !important;
    transition: all 0.3s ease;
}

.register-link-theme:hover,
.forgot-link-theme:hover {
    color: var(--primary-color-hover) !important;
    text-decoration: underline !important;
}

/* Theme Outline Button */
.forgot-outline-btn {
    border-color: var(--primary-color) !important;
    color: var(--primary-color) !important;
    background-color: transparent !important;
}

.forgot-outline-btn:hover {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #ffffff !important;
}

/* Theme Form Input Focus */
.auth-form .form-control:focus,
.form-control:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 0.2rem var(--primary-color-focus) !important;
}

/* Theme OTP Input Styles */
.otp-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem var(--primary-color-focus);
}

.otp-input.filled {
    border-color: var(--primary-color);
    background-color: var(--primary-color-bg-light);
}

/* Theme Primary Buttons (Register page uses .btn-primary) */
.btn-primary.btn-primary,
.btn-success.btn-success {
    background-color: var(--primary-color) !important;
    border: 2px solid var(--primary-color) !important;
    color: #ffffff !important;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px var(--primary-color-shadow);
}

.btn-primary:hover,
.btn-success:hover {
    background-color: var(--primary-color-hover) !important;
    border-color: var(--primary-color-hover) !important;
    box-shadow: 0 6px 16px var(--primary-color-shadow-hover) !important;
    transform: translateY(-2px);
    color: #ffffff !important;
}

.btn-outline-primary {
    border-color: var(--primary-color) !important;
    color: var(--primary-color) !important;
    background-color: transparent !important;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #ffffff !important;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .user-dashboard #searchContainer {
        flex-direction: column;
        gap: 10px;
    }
    
    .otp-input-container {
        gap: 5px;
    }
    
    .otp-input {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}
