:root {
    --primary-color: #4f46e5;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    --purple-color: #8b5cf6;
    --dark-color: #1f2937;
    --light-color: #f8fafc;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #374151;
    background-color: #f7fbff;
}

/* Custom Badge Colors */
.badge.bg-purple {
    background-color: var(--purple-color) !important;
}

/* Navbar Styling */
.navbar {
    padding: 1rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.navbar-brand {
    font-size: 1.25rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
}

.logo-icon i {
    font-size: 1.2rem;
    color: white !important;
}

.nav-link .badge {
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.nav-link:hover .badge {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.search-box-hero {
    max-width: 600px;
    margin: 0 auto;
}

.search-box-hero .form-control {
    border: none;
    border-radius: 50px 0 0 50px;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.search-box-hero .btn {
    border-radius: 0 50px 50px 0;
    padding: 1rem 2rem;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: none;
}

/* Category Cards */
.category-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s ease;
    cursor: pointer;
    min-height: 300px;
    border: 1px solid #e5e7eb !important;
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    border-color: rgba(0, 0, 0, 0.1) !important;
}

/* Remove focus outlines that cause blue borders */
.category-card:focus,
.category-card *:focus {
    outline: none !important;
    box-shadow: none !important;
    border-color: #e5e7eb !important;
}

/* Enhanced category card hover effects */
.category-card-hover {
    transition: all 0.3s ease;
}

.category-card-hover:hover {
    transform: translateY(-5px);
}

.category-card-hover .card {
    border: 1px solid #e5e7eb !important;
    border-radius: 15px;
    transition: all 0.3s ease;
    height: 100%;
}

.category-card-hover .card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
}

.category-card-hover .card:focus-within {
    outline: none !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
}

/* Remove any unwanted focus styles */
.category-card-hover .card *:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Improved card body layout */
.category-card-hover .card-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
    padding: 2rem 1.5rem;
    height: 100%;
}

.category-card-hover .card-title {
    margin-bottom: 1rem;
    font-weight: 600;
    font-size: 1.25rem;
    line-height: 1.3;
}

.category-card-hover .card-title a {
    text-decoration: none;
    transition: color 0.3s ease;
}

.category-card-hover .card-text {
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.5;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Consistent spacing for category stats */
.category-card-hover .d-flex {
    margin-top: auto;
    padding-top: 1rem;
}

.card-gradient {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-color), #6366f1);
    opacity: 0.9;
}

.card-gradient.bg-success {
    background: linear-gradient(135deg, var(--secondary-color), #059669);
}

.card-gradient.bg-danger {
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
}

.card-gradient.bg-warning {
    background: linear-gradient(135deg, var(--warning-color), #d97706);
}

.card-gradient.bg-info {
    background: linear-gradient(135deg, var(--info-color), #0891b2);
}

.card-gradient.bg-secondary {
    background: linear-gradient(135deg, #6b7280, #4b5563);
}

.card-content {
    position: relative;
    z-index: 2;
    padding: 2rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.category-icon {
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.2);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
}

.category-icon i {
    font-size: 1.5rem;
}

.category-card h4 {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.3;
}

.category-card p {
    flex-grow: 1;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Background Gradients */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 0;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
    
    .search-box-hero .form-control,
    .search-box-hero .btn {
        font-size: 1rem;
        padding: 0.8rem 1.2rem;
    }
    
    .category-card {
        min-height: 250px;
    }
    
    .card-content {
        padding: 1.5rem;
    }
    
    .category-card h4 {
        font-size: 1.1rem;
    }
}

/* Animation Classes */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3730a3;
}

/* Footer Styles */
.footer {
    background: var(--dark-color);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer h5 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.footer a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 1rem;
    margin-top: 2rem;
    text-align: center;
    color: #9ca3af;
}

/* Modal Enhancements */
.modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
}

.modal-header {
    border-bottom: 1px solid #e5e7eb;
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

/* Button Enhancements */
.btn {
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #6366f1);
    border: none;
}

.btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

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


/* Document Cards */
.document-card {
    transition: all 0.3s ease;
    border: none;
    border-radius: 15px;
}

.document-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1) !important;
}

.document-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
}

.document-card .card-text {
    font-size: 0.9rem;
    line-height: 1.5;
}

.download-stats {
    display: flex;
    align-items: center;
}

/* Popular Document Cards */
.popular-document-card {
    transition: all 0.3s ease;
    border: none;
    border-radius: 15px;
}

.popular-document-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.1) !important;
}

.document-thumbnail {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border-radius: 15px 0 0 15px;
}

.popularity-rank {
    display: flex;
    align-items: center;
}

.text-silver {
    color: #9ca3af;
}

.text-bronze {
    color: #cd7f32;
}

/* Subject Cards */
.subject-card {
    padding: 2rem 1rem;
    border-radius: 15px;
    background: white;
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
}

.subject-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}

.subject-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    transition: all 0.3s ease;
}

.subject-card:hover .subject-icon {
    transform: scale(1.1);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.subject-card:hover .subject-icon i {
    color: white !important;
}

/* Custom button colors */
.btn-outline-purple {
    color: var(--purple-color);
    border-color: var(--purple-color);
}

.btn-outline-purple:hover {
    background-color: var(--purple-color);
    border-color: var(--purple-color);
    color: white;
}

.text-purple {
    color: var(--purple-color) !important;
}

/* Section spacing */
section {
    position: relative;
}

section.bg-light {
    background-color: #f8fafc !important;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .document-card .card-body {
        padding: 1.25rem;
    }
    
    .popular-document-card .card-body {
        padding: 1rem;
    }
    
    .subject-card {
        padding: 1.5rem 1rem;
    }
    
    .subject-icon {
        width: 60px;
        height: 60px;
    }
    
    .subject-icon i {
        font-size: 1.5rem !important;
    }
    
    /* Improved mobile layout for category cards */
    .category-card-hover .card-body {
        padding: 1.5rem 1rem;
    }
    
    .category-card-hover .card-title {
        font-size: 1.1rem;
    }
    
    .category-card-hover .card-text {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    
    /* Ensure consistent card heights on mobile */
    .category-card-hover .card {
        min-height: 280px;
    }
}

/* Loading states */
.btn.loading {
    position: relative;
    color: transparent !important;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


/* Custom Breadcrumb Styles */
.custom-breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
    font-size: 0.95rem;
}

.custom-breadcrumb .breadcrumb-item {
    display: flex;
    align-items: center;
}

.custom-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: #6b7280;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0.75rem;
}

.custom-breadcrumb .breadcrumb-item a {
    color: #4f46e5;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

.custom-breadcrumb .breadcrumb-item a:hover {
    background-color: #f3f4f6;
    color: #3730a3;
    text-decoration: none;
}

.custom-breadcrumb .breadcrumb-item.active {
    color: #6b7280;
    font-weight: 500;
}

.custom-breadcrumb .breadcrumb-item i {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Breadcrumb responsive */
@media (max-width: 768px) {
    .custom-breadcrumb {
        font-size: 0.85rem;
    }
    
    .custom-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
        margin: 0 0.5rem;
    }
    
    .custom-breadcrumb .breadcrumb-item a {
        padding: 0.2rem 0.4rem;
    }
}

/* Share Modal Styles */
.share-modal .modal-body {
    text-align: center;
}

.share-options {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

.share-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: white;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    color: white;
}

.share-btn.facebook {
    background: #1877f2;
}

.share-btn.twitter {
    background: #1da1f2;
}

.share-btn.telegram {
    background: #0088cc;
}

.share-btn.copy {
    background: #6b7280;
}

.copy-link-input {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 0.9rem;
    color: #6b7280;
}

/* Document Preview Modal */
.preview-modal .modal-dialog {
    max-width: 90vw;
}

.preview-modal .modal-body {
    padding: 0;
}

.preview-modal iframe {
    border-radius: 0 0 15px 15px;
}

/* Download Button Enhancements */
.download-section {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
}

.download-btn-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #10b981 100%);
    border: none;
    border-radius: 12px;
    padding: 1rem 2rem;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.download-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
}

.action-buttons .btn {
    border-radius: 10px;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
}

.stats-row {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.stat-item {
    text-align: center;
    padding: 0 1rem;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

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


/* Enhanced icon styling for category cards */
.category-card-hover .card-title i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

/* Improved icon container for better visual hierarchy */
.category-icon-container {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    transition: all 0.3s ease;
}

.category-card-hover:hover .category-icon-container {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Typography improvements */
.category-card-hover .card-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.category-card-hover .card-text {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #6b7280;
    font-weight: 400;
}

/* Badge improvements */
.category-card-hover .badge {
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    letter-spacing: 0.025em;
}

/* Consistent card spacing */
.category-card-hover .card {
    min-height: 320px;
}

@media (min-width: 992px) {
    .category-card-hover .card {
        min-height: 350px;
    }
}

/* Sub-category list improvements */
.sub-category-list {
    margin: 1rem 0;
    padding: 0;
}

.sub-category-list li {
    margin-bottom: 0.75rem;
    padding-left: 0;
}

.sub-category-list a {
    color: #6b7280;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.sub-category-list a:hover {
    color: #4f46e5;
    transform: translateX(5px);
}

.sub-category-list a i {
    margin-right: 0.5rem;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.sub-category-list a:hover i {
    transform: translateX(3px);
}

/* Enhanced focus states for accessibility */
.category-card-hover .card:focus-visible {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
    border-color: #4f46e5 !important;
}

.category-card-hover .card a:focus-visible {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
    border-radius: 4px;
}



/* New Search Box Styles */
.search-input-group {
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    background-color: white;
}

.search-input-group .form-control {
    border: none;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    height: auto;
}

.search-input-group .form-control:focus {
    box-shadow: none;
    border-color: transparent;
}

.search-input-group .input-group-text {
    background-color: white;
    border: none;
    padding: 1rem 0.5rem 1rem 1.5rem;
    color: #6c757d;
    font-size: 1.1rem;
}

.search-input-group .btn {
    border-radius: 0 50px 50px 0;
    padding: 1rem 2rem;
    font-weight: 600;
    border: none;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(100, 100, 255, 0.3);
}

.search-input-group .btn:hover {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    box-shadow: 0 12px 30px rgba(100, 100, 255, 0.4);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .search-input-group .form-control,
    .search-input-group .input-group-text,
    .search-input-group .btn {
        padding: 0.8rem 1rem;
        font-size: 1rem;
    }
    .search-input-group .btn {
        padding: 0.8rem 1.5rem;
    }
}


