.boxed {
    border: 1px solid green;
    width: 40%;
    padding: 1%;
}

.row::after {
    content: "";
    clear: both;
    display: table;
}

.column {
    float: left;
    padding: 2%;
}

.paragraph {
    width: 90%;
    padding: 1%;
    border: aliceblue;
    justify-content: center;
}

.centered_image {
    display: block;
    margin-left: auto;
    margin-right: auto;
    width: 60%;
}


.centered_image_auto_width {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.centered_header_image {
    display: block;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 10px;
}

.empty_grid {
    display: inline-block;
    width: 10%;
    height: 100px;
    /*float: left;*/
    margin: 0;
    text-align: center;
}

.section-icon {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--primary);
    background: white;
    padding: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: block;
    margin-left: auto;
    margin-right: auto;
}


@media (min-width: 1200px) {
    .row > .col-lg-5:nth-child(3n+1) {
        clear: left;
    }
}

@media (max-width: 992px) {
    .row > .col-sm-6:nth-child(2n+1) {
        clear: left;
    }
}

.fermibot_preview_card {
    padding: 5px;
    border: solid #0b2e13;
}


/*CSS from bootstrap header theme*/

.bd-placeholder-img {
    font-size: 1.125rem;
    text-anchor: middle;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

@media (min-width: 768px) {
    .bd-placeholder-img-lg {
        font-size: 3.5rem;
    }
}

.b-example-divider {
    width: 100%;
    height: 3rem;
    background-color: rgba(0, 0, 0, .1);
    border: solid rgba(0, 0, 0, .15);
    border-width: 1px 0;
    box-shadow: inset 0 .5em 1.5em rgba(0, 0, 0, .1), inset 0 .125em .5em rgba(0, 0, 0, .15);
}

.b-section-divider {
    width: 100%;
    height: 3rem;
    background-color: rgba(0, 0, 0, .1);
    border: solid rgba(0, 0, 0, .15);
    border-width: 1px 0;
    box-shadow: inset 0 .5em 1.5em rgba(0, 0, 0, .1), inset 0 .125em .5em rgba(0, 0, 0, .15);
}

.b-example-vr {
    flex-shrink: 0;
    width: 1.5rem;
    height: 100vh;
}

.bi {
    vertical-align: -.125em;
    fill: currentColor;
}

.nav-scroller {
    position: relative;
    z-index: 2;
    height: 2.75rem;
    overflow-y: hidden;
}

.nav-scroller .nav {
    display: flex;
    flex-wrap: nowrap;
    padding-bottom: 1rem;
    margin-top: -1px;
    overflow-x: auto;
    text-align: center;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

.btn-bd-primary {
    --bd-violet-bg: #712cf9;
    --bd-violet-rgb: 112.520718, 44.062154, 249.437846;

    --bs-btn-font-weight: 600;
    --bs-btn-color: var(--bs-white);
    --bs-btn-bg: var(--bd-violet-bg);
    --bs-btn-border-color: var(--bd-violet-bg);
    --bs-btn-hover-color: var(--bs-white);
    --bs-btn-hover-bg: #6528e0;
    --bs-btn-hover-border-color: #6528e0;
    --bs-btn-focus-shadow-rgb: var(--bd-violet-rgb);
    --bs-btn-active-color: var(--bs-btn-hover-color);
    --bs-btn-active-bg: #5a23c8;
    --bs-btn-active-border-color: #5a23c8;
}

.bd-mode-toggle {
    z-index: 1500;
}

.bd-mode-toggle .dropdown-menu .active .bi {
    display: block !important;
}

.center-flex {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* ============================================
   MOBILE OPTIMIZATION
   ============================================ */

/* Tablet and below (768px) */
@media (max-width: 768px) {
    /* Container padding - reduce on mobile */
    .container-fluid.pb-3.p-5 {
        padding: 2rem 1.5rem !important;
    }

    /* Welcome section grid - stack vertically on mobile */
    .d-grid[style*="grid-template-columns: 1fr 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    /* Categories section grid - single column on mobile */
    .d-grid[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    /* Welcome boxes - better mobile sizing */
    .bg-body-tertiary.border.rounded-3 {
        padding: 1.5rem !important;
    }

    /* Section icons - smaller on mobile */
    .section-icon {
        width: 150px;
        height: 150px;
        border-width: 2px;
    }

    /* Centered images - full width on mobile */
    .centered_image {
        width: 90%;
    }

    /* Typography adjustments */
    h1 {
        font-size: 1.75rem !important;
    }

    h2 {
        font-size: 1.5rem !important;
    }

    h3 {
        font-size: 1.25rem !important;
        padding: 1.5rem 0 !important;
    }

    /* Text content - better readability */
    p {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    strong {
        font-size: 1.05rem;
    }

    /* Images - responsive */
    .img-fluid {
        max-width: 100%;
        height: auto;
    }

    /* Cards - better mobile spacing */
    .card {
        margin-bottom: 1.5rem;
    }

    .card-body {
        padding: 1.5rem;
    }

    /* Paragraph container */
    .paragraph {
        width: 100%;
        padding: 0.5rem;
    }
}

/* Small mobile devices (576px and below) */
@media (max-width: 576px) {
    /* Minimal padding on tiny screens */
    .container-fluid.pb-3.p-5 {
        padding: 1.5rem 1rem !important;
    }

    /* Tighter grid gaps */
    .d-grid {
        gap: 1rem !important;
    }

    /* Welcome boxes - compact padding */
    .bg-body-tertiary.border.rounded-3 {
        padding: 1rem !important;
    }

    /* Section icons - even smaller on tiny screens */
    .section-icon {
        width: 120px;
        height: 120px;
    }

    /* Typography - compact on tiny screens */
    h1 {
        font-size: 1.5rem !important;
    }

    h2 {
        font-size: 1.25rem !important;
    }

    h3 {
        font-size: 1.1rem !important;
        padding: 1rem 0 !important;
    }

    p {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    strong {
        font-size: 1rem;
    }

    /* Card compact spacing */
    .card-body {
        padding: 1rem;
    }

    /* Center image - more space on small screens */
    .centered_image {
        width: 100%;
    }
}

/* Medium tablets (between 576px and 992px) */
@media (min-width: 577px) and (max-width: 992px) {
    /* Categories grid - 2 columns on tablets */
    .d-grid[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr 1fr !important;
        gap: 1.5rem !important;
    }

    /* Section icons - medium size on tablets */
    .section-icon {
        width: 175px;
        height: 175px;
    }
}

/* Touch-friendly improvements for all mobile devices */
@media (hover: none) and (pointer: coarse) {
    /* Better touch targets for links and buttons */
    a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    /* Card links - easier to tap */
    .card a {
        display: block;
        padding: 0.25rem;
    }

    /* Better tap highlighting */
    * {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
}

/* Landscape mobile optimization */
@media (max-width: 768px) and (orientation: landscape) {
    /* Reduce vertical spacing in landscape */
    .container-fluid.pb-3.p-5 {
        padding: 1.5rem !important;
    }

    .d-grid {
        gap: 1rem !important;
    }

    h3 {
        padding: 1rem 0 !important;
    }
}

/* ============================================
   DESIGN ENHANCEMENTS - MODERN & MOBILE-FIRST
   ============================================ */

/* Root variables for theming */
:root {
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-hero: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
    --border-radius: 16px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark mode adjustments */
[data-bs-theme="dark"] {
    --gradient-hero: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Body enhancements */
body {
    overflow-x: hidden;
    transition: background-color 0.3s ease;
}

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

::-webkit-scrollbar-track {
    background: var(--bs-body-bg);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* Hero Section Enhancements */
.hero-section {
    background: var(--gradient-hero);
    border-radius: var(--border-radius);
    padding: 3rem 2rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: pulse 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

/* Welcome boxes - Modern glassmorphism */
.welcome-box {
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: var(--border-radius) !important;
    box-shadow: var(--shadow-md);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

[data-bs-theme="dark"] .welcome-box {
    background: rgba(33, 37, 41, 0.7) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.welcome-box:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.welcome-box::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.welcome-box:hover::after {
    left: 100%;
}

/* Animated GIF container */
.gif-container {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
    animation: glow 3s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(118, 75, 162, 0.5);
    }
}

.gif-container img {
    transition: transform 0.3s ease;
}

.gif-container:hover img {
    transform: scale(1.05);
}

/* Typography improvements */
/* NOTE: Previously this applied globally and made headings bold across many pages.
   Limit this styling to the home page cards section to avoid affecting page titles. */
#cards-container h1,
#cards-container h2,
#cards-container h3,
#cards-container h4,
#cards-container h5,
#cards-container h6 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Keep normal heading weight elsewhere (Bootstrap defaults) */
h1, h2, h3, h4, h5, h6 {
    font-weight: inherit;
    letter-spacing: normal;
}

.section-title {
    position: relative;
    display: inline-block;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    /* underline removed for cleaner headings */
    display: none;
}

/* Card entrance animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-on-scroll {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

/* Stagger animation delays */
.animate-on-scroll:nth-child(1) { animation-delay: 0.1s; }
.animate-on-scroll:nth-child(2) { animation-delay: 0.2s; }
.animate-on-scroll:nth-child(3) { animation-delay: 0.3s; }
.animate-on-scroll:nth-child(4) { animation-delay: 0.4s; }
.animate-on-scroll:nth-child(5) { animation-delay: 0.5s; }
.animate-on-scroll:nth-child(6) { animation-delay: 0.6s; }

/* Enhanced focus states for accessibility */
a:focus-visible,
button:focus-visible {
    outline: 3px solid rgba(102, 126, 234, 0.5);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Better link styling */
a {
    transition: color 0.2s ease;
}

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--border-radius);
}

[data-bs-theme="dark"] .skeleton {
    background: linear-gradient(90deg, #2a2a2a 25%, #1a1a1a 50%, #2a2a2a 75%);
    background-size: 200% 100%;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Mobile-specific enhancements */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 1.5rem;
    }

    .section-title::after {
        display: none;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* --- Index: grouped cards layout (categoryMain sections) --- */
.cards-sections {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.cards-section-title {
    margin: 0 0 0.75rem 0;
}

.cards-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

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

@media (min-width: 1200px) {
    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   CATEGORY CARDS ENHANCEMENTS
   ============================================ */

/* Card container spacing */
#cards-container {
    margin-top: 2rem;
}

/* Card hover effects */
#cards-container .welcome-box {
    cursor: pointer;
    min-height: 300px;
    display: flex;
    flex-direction: column;
}

#cards-container .welcome-box h5 {
    color: var(--bs-body-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Card list styling */
#cards-container ul {
    flex-grow: 1;
    margin: 0;
    padding-left: 1.5rem;
}

#cards-container ul li {
    margin-bottom: 0.4rem;
    line-height: 1.5;
}

#cards-container ul li a {
    color: var(--bs-body-color);
    text-decoration: none;
    position: relative;
    display: inline-block;
    transition: var(--transition-smooth);
}

#cards-container ul li a::before {
    content: '→ ';
    opacity: 0;
    transform: translateX(-10px);
    transition: var(--transition-smooth);
    display: inline-block;
}

#cards-container ul li a:hover::before {
    opacity: 1;
    transform: translateX(0);
}

#cards-container ul li a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

#cards-container ul li a:hover::after {
    width: 100%;
}

#cards-container ul li a:hover {
    color: #667eea;
    transform: translateX(5px);
}

/* Enhanced section icon styling */
.image-section-icon {
    transition: var(--transition-smooth);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.welcome-box:hover .image-section-icon {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 8px 16px rgba(102, 126, 234, 0.3));
}

/* Better list styling */
.list-unstyled li {
    position: relative;
    padding-left: 0;
}

/* ============================================
   TYPOGRAPHY REFINEMENTS
   ============================================ */

/* Better paragraph spacing */
p {
    line-height: 1.8;
    margin-bottom: 1rem;
}

strong {
    font-weight: 600;
    color: var(--bs-emphasis-color);
}

/* Better link contrast */
a {
    color: #667eea;
}

[data-bs-theme="dark"] a {
    color: #8b9cf6;
}

a:hover {
    color: #764ba2;
}

[data-bs-theme="dark"] a:hover {
    color: #a77fc6;
}

/* ============================================
   MOBILE TOUCH ENHANCEMENTS
   ============================================ */

@media (max-width: 768px) {
    /* Card minimum height on mobile */
    #cards-container .welcome-box {
        min-height: 250px;
    }

    /* Better touch targets for card links */
    #cards-container ul li a {
        padding: 0.5rem 0;
        display: block;
    }

    /* Simpler hover effects on touch devices */
    @media (hover: none) {
        #cards-container ul li a:active {
            transform: scale(0.98);
            color: #667eea;
        }

        .welcome-box:active {
            transform: scale(0.98);
        }
    }
}

/* ============================================
   LOADING STATE
   ============================================ */

/* Show skeleton loader while cards load */
#cards-container:empty::before {
    content: 'Loading...';
    display: block;
    text-align: center;
    padding: 3rem;
    color: var(--bs-secondary-color);
    font-size: 1.2rem;
    animation: pulse 1.5s infinite;
}

/* ============================================
   ADDITIONAL VISUAL POLISH
   ============================================ */

/* Smooth theme transitions */
* {
    transition-property: background-color, border-color, color;
    transition-duration: 0.2s;
    transition-timing-function: ease;
}

/* Prevent transition on animation properties */
*:not(.welcome-box):not(.animate-on-scroll) {
    transition-property: background-color, border-color, color;
}

/* Better selection color */
::selection {
    background: rgba(102, 126, 234, 0.3);
    color: var(--bs-body-color);
}

::-moz-selection {
    background: rgba(102, 126, 234, 0.3);
    color: var(--bs-body-color);
}
