:root {
    --bs-body-bg: #f8f9fa;
    --bs-body-color: #212529;
    --sidebar-bg: #ffffff;
    --sidebar-color: #343a40;
    --sidebar-brand-color: #0d6efd;
    --sidebar-link-color: #5a5c69;
    --sidebar-link-hover-color: #212529;
    --sidebar-link-active-bg: #e7f1ff;
    --sidebar-link-active-color: #0d6efd;
    --topbar-bg: #ffffff;
    --card-bg: #ffffff;
    --card-border-color: #e3e6f0;
    --border-color: #dddfeb;
}

[data-bs-theme="dark"] {
    --bs-body-bg: #212529;
    --bs-body-color: #f8f9fa;
    --sidebar-bg: #1c1f23;
    --sidebar-color: #adb5bd;
    --sidebar-brand-color: #ffffff;
    --sidebar-link-color: #adb5bd;
    --sidebar-link-hover-color: #ffffff;
    --sidebar-link-active-bg: #0d6efd;
    --sidebar-link-active-color: #ffffff;
    --topbar-bg: #282c30;
    --card-bg: #282c30;
    --card-border-color: #454d55;
    --border-color: #454d55;
}

html, body {
    height: 100%;
    width: 100%;
    margin: 0;
    overflow-x: hidden;
}

body {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
}

body.dashboard-body {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    box-shadow: 0 0 1rem rgba(0,0,0,.1);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 1030;
    transition: margin-left 0.3s ease-in-out;
}

html.sidebar-collapsed .sidebar {
    margin-left: -260px;
}

#sidebar-toggle-button {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1031;
}

.sidebar .sidebar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--sidebar-brand-color);
    text-decoration: none;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.sidebar .nav-container {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

.sidebar .nav-link {
    color: var(--sidebar-link-color);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    font-weight: 500;
}

.sidebar .nav-link .bi {
    margin-right: 1rem;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sidebar .nav-link span {
    white-space: normal;
    word-break: break-word;
    flex-grow: 1;
    min-width: 0;
}

.sidebar .nav-link:hover {
    color: var(--sidebar-link-hover-color);
    background-color: var(--sidebar-link-active-bg);
}

.sidebar .nav-link.active {
    color: var(--sidebar-link-active-color);
    background-color: var(--sidebar-link-active-bg);
    font-weight: 700;
}

.sidebar .nav-item .collapse .nav-link {
    padding-left: calc(1.5rem + 1rem + 1.1rem);
    font-size: 0.9em;
}

.content-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.topbar {
    background-color: var(--topbar-bg);
    box-shadow: 0 0.15rem 1.75rem rgba(58,59,69,.15);
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.topbar .nav-item .nav-link {
    color: var(--sidebar-link-color);
}

.main-content {
    padding: 2rem;
    flex-grow: 1;
    overflow-y: auto;
}

.card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border-color);
    transition: background-color 0.2s linear, border-color 0.2s linear;
}

.stat-card {
    text-decoration: none;
    display: block;
    height: 100%;
    color: var(--bs-body-color);
}

.stat-card:hover .card {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,.15);
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}

.text-xs {
    font-size: .8rem;
    font-weight: 700!important;
    text-transform: uppercase!important;
}

.h5 {
    font-size: 2.5rem;
}

.card.border-left-primary { border-left: .25rem solid #4e73df!important; }
.card.border-left-warning { border-left: .25rem solid #f6c23e!important; }
.card.border-left-danger { border-left: .25rem solid #e74a3b!important; }

.grid-stack {
    background: #e9ecef;
}

[data-bs-theme="dark"] .grid-stack {
    background: #1a1a1a;
}

.grid-stack-item-content {
    background: var(--card-bg);
    color: var(--bs-body-color);
    outline: 1px solid var(--card-border-color);
    outline-offset: -1px;
    border-radius: .375rem;
    display: flex;
    flex-direction: column;
    overflow: hidden !important;
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}

.grid-stack-item:not(.ui-draggable-dragging):hover > .grid-stack-item-content {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,.15);
}

.stat-card-content {
    padding: 1rem;
    display: flex;
    align-items: center;
    height: 100%;
    box-sizing: border-box;
}

.stat-card-content.border-left-primary { border-left: .25rem solid #4e73df!important; }
.stat-card-content.border-left-warning { border-left: .25rem solid #f6c23e!important; }
.stat-card-content.border-left-danger { border-left: .25rem solid #e74a3b!important; }

.grid-stack-placeholder > .placeholder-content {
    border: 2px dashed #0d6efd;
    background: rgba(13, 110, 253, 0.1);
    border-radius: .375rem;
}

.widget-header {
    padding: .75rem 1.25rem;
    border-bottom: 1px solid var(--card-border-color);
    flex-shrink: 0;
}

.widget-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.25rem;
    min-height: 0;
}

.widget-body-nopad {
    flex-grow: 1;
    overflow-y: auto;
    min-height: 0;
}

.widget-body-nopad .list-group-item {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    background-color: transparent;
}

.text-gray-300 {
    opacity: 0.3;
}

.clickable-row {
    cursor: pointer;
}

.hero-section {
    position: relative;
    padding: 120px 0;
    color: #ffffff;
    text-align: center;
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('../images/hero-background.webp') no-repeat center center;
    background-size: cover;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
}

.hero-section h1 {
    font-size: 3.5rem;
    font-weight: 700;
}

.hero-section .lead {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    min-height: 56px;
}

.typewriter-cursor {
    display: inline-block;
    background-color: #fff;
    width: 3px;
    animation: blink 1s step-end infinite;
    margin-left: 2px;
    vertical-align: text-bottom;
}

@keyframes blink {
    from, to { background-color: transparent; }
    50% { background-color: #fff; }
}

.animated-element {
    opacity: 0;
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.slide-from-left {
    transform: translateX(-50px);
}

.slide-from-right {
    transform: translateX(50px);
}

.animated-element.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.features-section {
    padding: 80px 0;
    background-color: var(--bs-tertiary-bg);
}

.feature-card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border-color);
    border-radius: 0.75rem;
    padding: 2rem;
    height: 100%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.feature-card .icon-container {
    font-size: 3rem;
    color: var(--bs-primary);
    margin-bottom: 1rem;
    display: inline-block;
}

.btn-demo-nav {
    background-color: #0d6efd;
    color: #fff !important;
    transition: all 0.3s ease;
    border-radius: 0.375rem;
    padding: 0.5rem 1rem;
}

.btn-demo-nav:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.4);
}

.demo-hero-section {
    padding: 6rem 0;
    background: linear-gradient(45deg, #212529, #4a3a69);
    color: #fff;
}

.demo-form-card {
    background-color: #fff;
    color: #212529;
    border-radius: 0.75rem;
    padding: 2.5rem;
    box-shadow: 0 1rem 3rem rgba(0,0,0,.175);
}

[data-bs-theme="dark"] .demo-form-card {
    background-color: var(--card-bg);
    color: var(--bs-body-color);
}

.benefits-section {
    padding: 100px 0;
}

.benefit-item {
    padding: 2rem;
}

.benefit-item h2 {
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1.2;
}

.benefit-item h2 span {
    color: #6f42c1;
}

.blog-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.blog-card {
    position: relative;
    border-radius: 0.5rem;
    overflow: hidden;
    height: 100%;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.blog-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.blog-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    padding: 1rem;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-top: 1px solid rgba(0,0,0,0.1);
}

[data-bs-theme="dark"] .blog-card-overlay {
    background: rgba(33, 37, 41, 0.9);
    border-top: 1px solid rgba(255,255,255,0.1);
}

.blog-card-title {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    font-weight: bold;
}

.blog-card-readmore {
    margin-bottom: 0;
    color: var(--bs-primary);
    font-weight: 500;
}

.form-card {
    background-color: var(--card-bg);
    border-radius: 0.75rem;
    padding: 2.5rem;
    box-shadow: 0 1rem 3rem rgba(0,0,0,.1);
}