/* Base Styles */
body {
    background-color: #F8F7FA;
    color: #6f6b7d;
    transition: background-color 0.3s, color 0.3s;
}

/* Dark Mode */
html.dark body {
    background-color: #333333;
    color: #ffffff;
}

html.dark .bg-white {
    background-color: #3d3d3d !important;
    border-color: #333333;
}

html.dark .text-gray-700,
html.dark .text-gray-600,
html.dark .text-gray-500,
html.dark .text-gray-400 {
    color: #ffffff !important;
}

html.dark .text-xs.text-gray-400,
html.dark .text-sm.text-gray-500 {
    color: rgba(255, 255, 255, 0.7) !important;
}

html.dark .border-gray-200,
html.dark .border-gray-100,
html.dark .border-gray-50 {
    border-color: #333333 !important;
}

html.dark .bg-gray-100,
html.dark .bg-gray-50 {
    background-color: #2b2b2b !important;
}

html.dark input {
    color: #ffffff;
    background-color: transparent;
}

html.dark .hover\:bg-gray-50:hover,
html.dark .hover\:bg-gray-100:hover {
    background-color: #2b2b2b !important;
}

/* Animations */
#sidebar {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 260px;
    white-space: nowrap;
}

body.collapsed #sidebar {
    width: 80px;
}

body.collapsed .menu-label,
body.collapsed .menu-arrow,
body.collapsed .brand-text,
body.collapsed .user-info {
    opacity: 0;
    pointer-events: none;
    position: absolute;
    visibility: hidden;
}

body.collapsed .nav-item {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

/* Scrollbar */
.custom-scroll::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scroll::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

html.dark .custom-scroll::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Navigation */
.nav-item.active {
    background: linear-gradient(72.47deg, #852221 22.16%, #a02b2a 76.47%);
    box-shadow: 0px 2px 6px 0px rgba(133, 34, 33, 0.48);
    color: white !important;
}

.nav-item.active i {
    color: white !important;
}

html.dark .nav-item.active {
    background: rgba(133, 34, 33, 0.2);
    box-shadow: none;
    color: #ff8f8f !important;
}

html.dark .nav-item.active i {
    color: #ff8f8f !important;
}

.nav-item,
.sub-item,
.smooth-slide-hover,
.table-row-hover {
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nav-item:hover,
.sub-item:hover,
.smooth-slide-hover:hover {
    transform: translateX(6px);
}

.sub-item .menu-label {
    color: #6b7280;
}

.sub-item.active .menu-label {
    color: #852221 !important;
    font-weight: 600;
}

html.dark .sub-item.active .menu-label {
    color: #ff8f8f !important;
}

.sub-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #dbdbdb;
    margin-right: 12px;
}

.sub-item.active .sub-dot {
    background-color: #852221;
    box-shadow: 0 0 6px rgba(133, 34, 33, 0.6);
}

html.dark .sub-item.active .sub-dot {
    background-color: #ff8f8f;
}

/* Components */
.view-section {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.view-section.active-view {
    display: block;
    opacity: 1;
}

.dropdown-menu {
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Table Row Specific Polish */
.table-row-hover {
    transition: all 0.3s ease !important;
    border-left: 3px solid transparent;
}

.table-row-hover:hover {
    transform: translateX(4px);
    background-color: rgba(133, 34, 33, 0.03) !important;
    box-shadow: inset 4px 0 0 0 #852221 !important;
}

html.dark .table-row-hover:hover {
    background-color: rgba(255, 255, 255, 0.03) !important;
    box-shadow: inset 4px 0 0 0 #ff8f8f !important;
}

/* Prevent table text from wrapping */
td,
th {
    white-space: nowrap;
}

.header-tab.active-tab {
    color: #852221;
    font-weight: 500;
}

.header-tab::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #852221;
    transition: width 0.3s ease;
}

html.dark .header-tab.active-tab {
    color: #852221 !important;
}

html.dark .header-tab:not(.active-tab) {
    color: #ffffff !important;
}

.page-tab-active {
    color: #852221 !important;
    border-bottom-color: #852221 !important;
}

.page-tab-inactive {
    color: #6b7280;
    border-bottom-color: transparent;
}

html.dark .page-tab-inactive {
    color: #9ca3af;
}

.card-hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

html.dark .card-hover-lift:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

/* Chart Fixes */
.circular-chart {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    max-height: 250px;
}

.circle-bg {
    fill: none;
    stroke: #EBE9F1;
    stroke-width: 2.5;
}

.circle {
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    animation: progress 1s ease-out forwards;
    stroke: #852221;
}

@keyframes progress {
    0% {
        stroke-dasharray: 0 100;
    }
}

html.dark .circle-bg {
    stroke: #444;
}

.percentage {
    fill: #5E5873;
    font-family: 'Public Sans', sans-serif;
    font-weight: bold;
    font-size: 0.5em;
    text-anchor: middle;
}

html.dark .percentage {
    fill: #fff;
}

/* Mini Bars */
.bar-chart-mini {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 40px;
}

.bar-chart-mini .bar {
    width: 6px;
    border-radius: 4px 4px 0 0;
    opacity: 0.85;
    transition: height 0.3s ease;
}

.bar-chart-mini .bar:hover {
    opacity: 1;
    transform: scaleY(1.1);
    transform-origin: bottom;
}

/* Chat UI Styles */
.chat-bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 12px;
    position: relative;
    font-size: 0.9rem;
    line-height: 1.4;
}

.chat-sent {
    background-color: #852221;
    color: white;
    border-bottom-right-radius: 2px;
    margin-left: auto;
}

.chat-received {
    background-color: #f3f4f6;
    color: #374151;
    border-bottom-left-radius: 2px;
}

html.dark .chat-received {
    background-color: #2b2b2b;
    color: #e5e7eb;
}

/* --- NEW: Login Screen Styles --- */
#login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #F8F7FA;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#dashboard-container {
    opacity: 0;
    transition: opacity 0.8s ease;
}

/* Developer Contact */
.social-text {
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 15px;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.social-icon {
    width: 35px;
    height: 35px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: red;
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-icon:hover {
    background: linear-gradient(45deg, red, red);
    color: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(25, 0, 255, 0.4);
}

.social-icon svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.animate-blink {
    animation: blink 1s ease-in-out infinite;
}

.my-toast-icon {
    font-size: 12px !important;

}

.my-toast-title {
    font-weight: 500 !important;
    font-size: 14px !important;
    text-align: left !important;
}

.my-toast-popup {
    padding-top: 3px !important;
    padding-bottom: 3px !important;

}

.textarea-tes {
    width: 100%;
    height: 80px
}

.table-tes {
    width: 100%;
    border-collapse: collapse
}

.td-tes,
.th-tes {
    border: 1px solid #ccc;
    padding: 6px
}

.pre-tes {
    background: #eee;
    padding: 10px
}