* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans Devanagari', Arial, sans-serif;
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: #f0f0e0;
}

/* Sidebar */
.sidebar {
    width: 320px;
    background: #2d3349;
    border-right: 1px solid #404660;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    color: #e8eaf2;
}

.sidebar.collapsed {
    width: 50px;
}

.sidebar-header {
    padding: 16px;
    background: #252b3d;
    border-bottom: 1px solid #404660;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 60px;
}

.sidebar.collapsed .sidebar-header {
    padding: 16px 8px;
}

.sidebar-title {
    font-size: 16px;
    font-weight: 600;
    color: #9C27B0;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.2s ease;
}

.sidebar.collapsed .sidebar-title {
    opacity: 0;
    width: 0;
}

.sidebar-toggle {
    width: 32px;
    height: 32px;
    background: #404660;
    border: 1px solid #5a6077;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #9C27B0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    background: #5a6077;
    transform: scale(1.05);
}

.sidebar.collapsed .sidebar-toggle {
    transform: rotate(180deg);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    transition: opacity 0.2s ease;
}

.sidebar.collapsed .sidebar-content {
    opacity: 0;
    pointer-events: none;
}

.section {
    margin-bottom: 24px;
}

.section h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #9C27B0;
    border-bottom: 1px solid #404660;
    padding-bottom: 8px;
}

.nav-link {
    display: inline-block;
    padding: 8px 16px;
    background: #404660;
    color: #9C27B0;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    margin-right: 10px;
    margin-bottom: 10px;
    transition: all 0.2s;
    border: 1px solid #5a6077;
}

.nav-link:hover {
    background: #5a6077;
    transform: translateY(-1px);
}

hr {
    border: none;
    border-top: 1px solid #404660;
    margin: 20px 0;
}

.instructions {
    font-size: 13px;
    line-height: 1.8;
    color: #cbd0e0;
    background: #252b3d;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #404660;
}

.content-info {
    font-size: 13px;
    line-height: 1.8;
    color: #cbd0e0;
    background: #252b3d;
    padding: 16px;
    border-radius: 6px;
    border: 1px solid #404660;
}

.footer {
    font-size: 11px;
    color: #8f97b3;
    text-align: center;
    border-top: 1px solid #404660;
    padding-top: 16px;
    margin-top: 24px;
}

/* Main Content */
.main-content {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #f8f4e8;
}

.header-controls {
    position: absolute;
    top: 16px;
    left: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
}

.page-title {
    background: rgba(255, 255, 255, 0.95);
    color: #9C27B0;
    padding: 10px 24px;
    border-radius: 30px;
    font-size: 18px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid #9C27B0;
    backdrop-filter: blur(5px);
}

.badge {
    background: rgba(255, 255, 255, 0.95);
    color: #9C27B0;
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid #9C27B0;
    backdrop-filter: blur(5px);
}

#container {
    flex: 1;
    overflow: auto;
    position: relative;
    background: #f8f4e8;
    padding: 20px;
}

svg {
    display: block;
    margin: 0 auto;
    background: #f8f4e8;
    border: 1px solid #d0b890;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

/* Node styling */
.node rect {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    transition: filter 0.2s ease;
    cursor: pointer;
}

.node:hover rect {
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
}

.node text {
    user-select: none;
    font-family: 'Noto Sans Devanagari', Arial, sans-serif;
    fill: #000000;  /* All text black */
    pointer-events: none;
}

.connection path {
    stroke: #9c9c9c;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    opacity: 0.7;
    transition: stroke 0.2s ease;
    pointer-events: none;
}

.connection:hover path {
    stroke: #9C27B0;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

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

::-webkit-scrollbar-thumb {
    background: #9C27B0;
    border-radius: 6px;
    border: 3px solid #e0d8c8;
}

::-webkit-scrollbar-thumb:hover {
    background: #7B1FA2;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sidebar:not(.collapsed) {
        width: 280px;
    }
    
    .page-title {
        font-size: 16px;
        padding: 8px 16px;
    }
    
    .badge {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* Animation */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.8; }
    100% { opacity: 1; }
}

.start-state {
    animation: pulse 2s infinite;
}
