/* 
 * Handouts Online - Main Stylesheet
 * Bootstrap 5 Theme Extensions and Customizations
 */

/* ===== Google Fonts Import ===== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Lora:wght@400;500;600;700&display=swap');

/* ===== Global Styles ===== */
:root {
    --primary: #3e6fd9;
    --primary-dark: #2c59ba;
    --secondary: #6c757d;
    --success: #28a745;
    --info: #17a2b8;
    --warning: #ffc107;
    --danger: #dc3545;
    --light: #f8f9fa;
    --dark: #343a40;
    --bg-color: #f0f4f9;
    --border-color: #e1e5e9;
    --font-family-sans-serif: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-family-serif: 'Lora', Georgia, 'Times New Roman', serif;
}

body {
    font-family: var(--font-family-sans-serif);
    color: #495057;
    background-color: var(--bg-color);
    font-weight: 300;
    line-height: 1.7;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-serif);
    color: #212529;
    font-weight: 700;
    line-height: 1.3;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

a:hover {
    color: var(--primary-dark);
}

.btn {
    border-radius: 4px;
    padding: 0.6rem 1.2rem;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    letter-spacing: 0.01em;
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 2px 4px rgba(62, 111, 217, 0.2);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: 0 4px 8px rgba(62, 111, 217, 0.3);
}

.btn-outline-secondary {
    color: #6c757d;
    border-color: #d1d6db;
}

.btn-outline-secondary:hover, .btn-outline-secondary:focus {
    background-color: #f8f9fa;
    border-color: #6c757d;
    color: #495057;
}

/* ===== Custom Components ===== */

/* Navigation */
.navbar {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    padding: 0.75rem 0;
}

.navbar-brand img {
    height: 40px;
}

.navbar .nav-link {
    font-weight: 600;
    padding: 0.5rem 1rem;
    color: #495057;
}

.navbar .nav-link:hover, .navbar .nav-link:focus {
    color: var(--primary);
}

.navbar .dropdown-menu {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border-radius: 0.375rem;
}

.navbar .dropdown-item {
    padding: 0.5rem 1.5rem;
    font-weight: 500;
}

.navbar .dropdown-item:hover, .navbar .dropdown-item:focus {
    background-color: rgba(79, 109, 245, 0.1);
    color: var(--primary);
}


/* Cards */
.card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-title {
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.card-subtitle {
    font-weight: 500;
    color: var(--secondary);
    margin-bottom: 0.75rem;
}

/* Badges */
.badge {
    font-weight: 600;
    padding: 0.35em 0.65em;
    border-radius: 0.25rem;
}

/* Pagination */
.pagination {
    margin-bottom: 0;
}

.pagination .page-link {
    padding: 0.375rem 0.75rem;
    margin: 0 0.25rem;
    border-radius: 0.25rem;
    border: none;
    color: var(--secondary);
    font-weight: 500;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary);
    color: white;
}

.pagination .page-item.disabled .page-link {
    color: #dee2e6;
}

/* Footer */
footer {
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 3rem 0 1.5rem;
}

footer h5 {
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
    font-weight: 700;
}

footer .social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: #e9ecef;
    border-radius: 50%;
    color: var(--secondary);
    transition: all 0.2s ease-in-out;
}

footer .social-icons a:hover {
    background-color: var(--primary);
    color: white;
}

/* ===== Worksheet Components ===== */

/* Import worksheet card specific styles */
@import url('worksheet-cards.css');

/* Category tags */
.category-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    background-color: #e9ecef;
    color: var(--secondary);
    transition: all 0.2s ease-in-out;
}

.category-tag:hover {
    background-color: #dee2e6;
    color: var(--dark);
    text-decoration: none;
}

.category-tag.active {
    background-color: var(--primary);
    color: white;
}

/* Toast notifications */
.toast-container {
    z-index: 1060;
}

/* ===== Form Elements ===== */
.form-control {
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    border-color: #ced4da;
}

.form-control:focus {
    border-color: rgba(79, 109, 245, 0.4);
    box-shadow: 0 0 0 0.25rem rgba(79, 109, 245, 0.25);
}

.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-text {
    color: #6c757d;
    font-size: 0.875rem;
}

/* ===== Auth Pages ===== */
.auth-wrapper {
    display: flex;
    align-items: center;
    min-height: calc(100vh - 72px - 217px);
    padding: 3rem 0;
}

.auth-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 2rem;
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.05);
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo img {
    height: 60px;
}

.auth-title {
    text-align: center;
    margin-bottom: 1.5rem;
    font-weight: 700;
    font-size: 1.75rem;
}

.auth-subtitle {
    text-align: center;
    margin-bottom: 2rem;
    color: #6c757d;
}

.auth-form .form-group {
    margin-bottom: 1.25rem;
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    color: #6c757d;
    font-size: 0.875rem;
}

.auth-links {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
}

/* ===== Profile Page ===== */
.profile-header {
    background-color: white;
    border-radius: 0.5rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #adb5bd;
    margin-right: 2rem;
}

.profile-stats {
    display: flex;
    margin-top: 1.5rem;
}

.profile-stat {
    text-align: center;
    padding: 0 1.5rem;
    border-right: 1px solid #dee2e6;
}

.profile-stat:last-child {
    border-right: none;
}

.profile-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.profile-stat-label {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* ===== Dashboard ===== */
.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.dashboard-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.dashboard-card-footer {
    margin-top: auto;
    padding-top: 1rem;
}

.dashboard-stat {
    padding: 1.5rem;
    border-radius: 0.5rem;
    background-color: white;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 1.5rem;
}

.dashboard-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.dashboard-stat-label {
    color: #6c757d;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 992px) {
    .navbar-brand img {
        height: 36px;
    }
    

}

@media (max-width: 768px) {
    .navbar {
        padding: 0.5rem 0;
    }
    
    .navbar-brand img {
        height: 32px;
    }
        
    .auth-container {
        padding: 1.5rem;
    }
    
    .profile-header {
        padding: 1.5rem;
    }
    
    .profile-avatar {
        width: 80px;
        height: 80px;
        font-size: 2rem;
        margin-right: 1.5rem;
    }
    
    .profile-stats {
        flex-wrap: wrap;
    }
    
    .profile-stat {
        flex: 0 0 50%;
        padding: 0.75rem 0;
        border-right: none;
        border-bottom: 1px solid #dee2e6;
    }
    
    .profile-stat:nth-last-child(-n+2) {
        border-bottom: none;
    }
}

@media (max-width: 576px) {
    
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-avatar {
        margin-right: 0;
        margin-bottom: 1.5rem;
    }
    
    .profile-stat {
        flex: 0 0 100%;
    }
    
    .profile-stat:nth-last-child(2) {
        border-bottom: 1px solid #dee2e6;
    }
}

/* Navbar Styling */

        .logo-text {
            font-family: 'Poppins', sans-serif;
            font-weight: 700;
            font-size: 1.6rem;
            color: #3068B7;
            letter-spacing: -0.5px;
        }
        
        .logo-text:hover {
            color: #1E4C8A;
            text-decoration: none;
        }
        
        .logo-icon {
            color: #3068B7;
            font-size: 1.8rem;
            margin-right: 6px;
        }
        
        /* Modal menu styling */
        .categories-modal .modal-dialog {
            max-width: 900px;
        }
        
        .categories-modal .modal-header {
            border-bottom: 2px solid #3068B7;
        }
        
        .categories-modal .modal-title {
            font-family: 'Poppins', sans-serif;
            font-weight: 600;
            color: #3068B7;
        }
        
        .categories-modal .category-header {
            color: #3068B7;
            font-weight: 600;
            font-size: 18px;
            margin-bottom: 8px;
            padding-bottom: 6px;
            border-bottom: 1px solid #e9ecef;
        }
        
        .categories-modal .category-list {
            list-style: none;
            padding-left: 0;
        }
        
        .categories-modal .category-list li {
            margin-bottom: 4px; /* Reduced from 8px */
        }
        
        .categories-modal .category-list a {
            color: #495057;
            text-decoration: none;
            display: block;
            padding: 3px 0; /* Reduced from 5px */
            transition: color 0.2s ease;
        }
        
        .categories-modal .category-list a:hover {
            color: #3068B7;
        }
        
        .categories-modal .btn-group {
            margin-top: 10px;
        }
        
        .divider-line {
            height: 1px;
            background-color: #e9ecef;
            margin: 15px 0; /* Reduced from 20px */
        }

/* End of Navbar Styling */

/* CSS for the promotional section */
.promo-section {
    margin-bottom: 3rem;
}

.promo-section .card {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.promo-section .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.promo-section h3 {
    color: #2c3e50;
    font-weight: 600;
}

.promo-section .lead {
    color: #5d6778;
}

.promo-section .btn-primary {
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    font-weight: 500;
}

.promo-section .btn-outline-primary {
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    font-weight: 500;
}

.promo-section img {
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.promo-section .card:hover img {
    transform: scale(1.05);
}


/* CSS for Image Split */

/* Styles for segmented images */
.secure-image-container {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid #ddd; /* Add a thin border around the entire container */
    border-radius: 4px; /* Optional: slightly rounded corners */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Add a subtle shadow */
}

.image-segment {
    flex: 1;
    margin-bottom: -1px; /* Remove gaps between segments */
    position: relative;
}

/* Only apply border to the container, not individual segments */
.image-segment img {
    display: block;
    pointer-events: none; /* Prevent direct interaction with the image */
    border: none; /* Ensure no borders on individual segments */
    width: 100%;
}

/* Make sure the last segment doesn't have a negative margin to avoid border issues */
.image-segment:last-child {
    margin-bottom: 0;
}

/* Optional: Add watermark overlay to prevent screenshots */
.secure-image-container::after {
	/*
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><text x="10" y="30" font-family="Arial" font-size="10" opacity="0.05" transform="rotate(45 50 50)">Preview Only</text></svg>');
    */
}

/* Styling for rich text content from Quill */
.description-text {
    /* Base container styling */
    font-size: 1rem;
    line-height: 1.5;
}

/* Paragraph styling within description */
.description-text p {
    margin-bottom: 0.8rem;
}

/* Last paragraph shouldn't have bottom margin */
.description-text p:last-child {
    margin-bottom: 0;
}

/* Empty paragraphs should have minimal height */
.description-text p:empty {
    height: 0.75rem;
    margin-bottom: 0;
}

/* Lists within description */
.description-text ul, 
.description-text ol {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.description-text li {
    margin-bottom: 0.4rem;
}

.description-text li:last-child {
    margin-bottom: 0;
}

/* Links in description */
.description-text a {
    color: #3068B7;
    text-decoration: underline;
}

.description-text a:hover {
    color: #1E4C8A;
}

/* Emphasized text */
.description-text strong, 
.description-text b {
    font-weight: 600;
}

.description-text em,
.description-text i {
    font-style: italic;
}