/* sidebar.css */
/* Sidebar Styles */
.sidebar {
    width: 250px;
    height: 100vh;
    position: fixed;
    background: #ffffff00;
    transition: all 0.3s;
    padding-top: 20px;
    z-index: 1000;
    overflow-y: auto;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    border-right: 1px solid #ffffff1f;

}

.sidebar.active {
    background: #ffffff00;
    backdrop-filter: blur(20px);
}

body.dark .sidebar {
    background: var(--dark-theme-dark2);
    backdrop-filter: blur(20px);
}

body.dark .sidebar.active {
    background: #2d2f3100;
    backdrop-filter: blur(20px);
}

.sidebar-collapsed {
    width: 60px;
}

/* Make the logo clickable and apply the gradient */
.sidebar-logo {
    text-align: center;
    padding: 10px;
    background: linear-gradient(90deg, var(--nano-accent), #34c759);
    -webkit-background-clip: text;
    color: transparent;
}

.logo-link {
    text-decoration: none;
    color: inherit;
}

.sidebar-logo h1 {
    background: linear-gradient(90deg, var(--nano-accent), #34c759);
    -webkit-background-clip: text;
    color: transparent;
    font-weight: 100;
    font-size: 2.5em;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-item {
    padding: 10px 15px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    background: transparent;
    border: none;
    color: var(--nano-dark);
    border-left: 3px solid transparent;
    width: -webkit-fill-available;
    font-size: 1em;
}


body.dark .sidebar-item {

    color: #fff;;
}

.sidebar-item:hover, .sidebar-item.active {
    background: rgba(74, 144, 226, 0.1);
    border-left: 3px solid var(--nano-accent);
}

.sidebar-icon {
    font-size: 18px;
    min-width: 20px;
    text-align: center;
}

svg.lucide.lucide-moon.sidebar-icon.theme-moon {
    display: inline-block !important;
}

body.dark svg.lucide.lucide-moon.sidebar-icon.theme-moon {
    display: none !important;
}

svg.lucide.lucide-sun.sidebar-icon.theme-sun {
    display: none !important;
}

body.dark svg.lucide.lucide-sun.sidebar-icon.theme-sun {
    display: inline-block !important;
}

.sidebar-text {
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.3s;
    left: 50px;
    position: absolute;
}

.sidebar-collapsed .sidebar-text {
    opacity: 0;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* Toggle button for sidebar */
.toggle-sidebar {
    position: fixed;
    top: 20px;
    left: 10px;
    z-index: 1001;
    background: #f5f7fa00;
    border: none;
    cursor: pointer;
    display: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    padding: 6px;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.toggle-sidebar.active {
    backdrop-filter: blur(0px);
}

body.dark .toggle-sidebar.active {
    backdrop-filter: blur(0px);
}

.toggle-sidebar .icon {
    width: 100%;
    height: 100%;
}

.toggle-sidebar .icon path {
    stroke: var(--nano-dark);
    stroke-width: 2;
    stroke-linecap: round;
    fill: none;
    transition: d 0.1s ease-in-out;
}

/* Default state (hamburger) */
.toggle-sidebar .icon #top-line {
    d: path("M2 6h20");
}

.toggle-sidebar .icon #middle-line {
    d: path("M2 12h20");
}

.toggle-sidebar .icon #bottom-line {
    d: path("M2 18h20");
}

/* Active state (X) */
.toggle-sidebar.active .icon #top-line {
    d: path("M6 6l12 12");
}

.toggle-sidebar.active .icon #middle-line {
    d: path("M12 12h0"); 
}

.toggle-sidebar.active .icon #bottom-line {
    d: path("M6 18l12 -12");
}


body.dark .toggle-sidebar .icon path {
    stroke: var(--nano-light);
}

/* Bottom Mobile Nav */
.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: none;
    justify-content: space-around;
    padding: 10px 0;
    z-index: 1000;
    background: #ffffff00;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(20px);
    border-top: 1px solid #ffffff1f;
}

body.dark .mobile-nav {
    background: #2d2f3100;
    backdrop-filter: blur(20px);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--nano-dark);
    font-size: 0.8em;
    background: transparent;
    border: 0;
    cursor: pointer;
}

body.dark .mobile-nav-item {
    color: var(--nano-light);
}

.mobile-nav-item i {
    font-size: 1.5em;
    margin-bottom: 5px;
}

.mobile-nav-item.active {
    color: var(--nano-accent);
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark .mobile-nav-item.active {
    color: var(--nano-accent);
    transition: background-color 0.3s ease, color 0.3s ease;
}

a.mobile-nav-item:hover {
    color: var(--nano-accent);
}

/* Smooth transitions */
.tab-pane {
    transition: opacity 0.3s ease;
}

.tab-pane.active {
    opacity: 1;
}

.tab-pane:not(.active) {
    opacity: 0;
    height: 0;
    overflow: hidden;
}

/* Modern button styles */
.xno-button {
    background: var(--nano-accent);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.sidebar .xno-button:hover {
    background: var(--nano-blue);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

body.dark .xno-button {
    background: var(--nano-blue);
}

body.dark .sidebar .xno-button:hover {
    background: #3580d8;
}

/* Dashboard styles */
.dashboard-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

body.dark .dashboard-section {
    background: var(--dark-theme-dark);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* Transaction styling */
.transaction-record {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

body.dark .transaction-record {
    border-bottom: 1px solid #333;
}

.transaction-record:hover {
    background-color: #f9fafb;
}

body.dark .transaction-record:hover {
    background-color: #2a2a2a;
}

.transaction-hash {
    font-family: monospace;
    color: var(--nano-accent);
    font-size: 0.9em;
    text-decoration: none;
}

/* XnoLink list styling */
.xno-link-list {
    list-style: none;
    padding: 0;
}

.xno-link-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

body.dark .xno-link-item {
    border-bottom: 1px solid #333;
}

.xno-link-item:last-child {
    border-bottom: none;
}

.xno-link-item:hover {
    background-color: #f9fafb;
}

body.dark .xno-link-item:hover {
    background-color: #2a2a2a;
}

button:focus-visible, a:focus-visible {
    outline: 2px solid var(--nano-accent);
    outline-offset: 2px;
}

body.dark button:focus, body.dark a:focus {
    outline-color: var(--nano-blue);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

body.dark ::-webkit-scrollbar-thumb {
    background: #4b5563;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

body.dark ::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* Media Queries for Sidebar and Mobile Nav */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-120%);
        width: 200px;
        scale: 1;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .toggle-sidebar {
        display: block;
    }

    .mobile-nav {
        display: flex;
        transform: translateY(0); /* Make mobile-nav stay at the top */
        transition: transform 0.3s ease-in-out;
    }

    .sidebar.active ~ .mobile-nav {
        transform: translateY(100vh); /* Make mobile-nav stay at the top */
        transition: transform 0.3s ease-in-out;
    }
    
}