/* Enhanced CSS with modern design and animations */
        :root {
            --primary-color: #4CAF50;
            --primary-dark: #45a049;
            --secondary-color: #FF5722;
            --accent-color: #2196F3;
            --text-color: #333;
            --light-bg: #f8f9fa;
            --dark-bg: #343a40;
            --node-color: #87CEEB;
            --visited-color: #FFC107;
            --path-color: #9C27B0;
            --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            --transition: all 0.3s ease;
        }

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

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            line-height: 1.6;
            color: var(--text-color);
            background-color: var(--light-bg);
            min-height: 100vh;
            display: flex;
            flex-direction: column;
        }

        header {
            background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
            color: white;
            padding: 1.5rem 0;
            text-align: center;
            box-shadow: var(--shadow);
            position: relative;
            z-index: 10;
        }

        h1 {
            font-size: 2rem;
            margin-bottom: 0.5rem;
        }

        .subtitle {
            font-size: 1rem;
            opacity: 0.9;
            font-weight: normal;
        }

        main {
            flex: 1;
            padding: 2rem;
            max-width: 1200px;
            margin: 0 auto;
            width: 100%;
        }

        .simulator-container {
            display: flex;
            flex-direction: column;
            gap: 2rem;
        }

        .canvas-container {
            position: relative;
            margin: 0 auto;
            max-width: 100%;
            border: 2px solid var(--dark-bg);
            border-radius: 8px;
            background: white;
            box-shadow: var(--shadow);
        }

        canvas {
            display: block;
            width: 100%;
            height: 100%;
        }

        .control-panel {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 1rem;
            margin: 1rem 0;
        }

        button {
            padding: 0.8rem 1.5rem;
            background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
            color: white;
            border: none;
            border-radius: 50px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
            box-shadow: var(--shadow);
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
        }

        button:hover {
            transform: translateY(-3px);
            box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
            background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
        }

        button:active {
            transform: translateY(1px);
        }

        button.active {
            background: var(--secondary-color);
        }

        button.reset {
            background: linear-gradient(135deg, #f44336, #d32f2f);
        }

        #log {
            background: white;
            border-radius: 8px;
            padding: 1.5rem;
            box-shadow: var(--shadow);
            max-height: 200px;
            overflow-y: auto;
            font-family: 'Courier New', Courier, monospace;
            font-size: 0.9rem;
            line-height: 1.5;
        }

        .log-entry {
            margin-bottom: 0.5rem;
            padding-bottom: 0.5rem;
            border-bottom: 1px solid #eee;
        }

        .log-entry:last-child {
            border-bottom: none;
        }

        .popup {
            position: fixed;
            top: 1rem;
            right: 1rem;
            max-width: 350px;
            background: white;
            border-radius: 8px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
            padding: 1.5rem;
            z-index: 1000;
            transform: translateX(120%);
            transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
        }

        .popup.visible {
            transform: translateX(0);
        }

        .popup-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1rem;
        }

        .popup-close {
            background: none;
            border: none;
            font-size: 1.5rem;
            cursor: pointer;
            color: #666;
        }

        .notification {
            position: fixed;
            bottom: 1rem;
            left: 50%;
            transform: translateX(-50%);
            background: var(--primary-color);
            color: white;
            padding: 1rem 2rem;
            border-radius: 50px;
            box-shadow: var(--shadow);
            opacity: 0;
            transition: opacity 0.3s ease;
            z-index: 1000;
        }

        .notification.show {
            opacity: 1;
        }

        footer {
            background: var(--dark-bg);
            color: white;
            text-align: center;
            padding: 1.5rem;
            margin-top: 2rem;
        }

        /* Animations */
        @keyframes pulse {
            0% { transform: scale(1); }
            50% { transform: scale(1.1); }
            100% { transform: scale(1); }
        }

        .pulse {
            animation: pulse 0.5s ease;
        }

        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        .fade-in {
            animation: fadeIn 0.5s ease;
        }

        /* Responsive Design */
        @media (max-width: 768px) {
            h1 {
                font-size: 1.5rem;
            }
            
            .subtitle {
                font-size: 0.9rem;
            }
            
            main {
                padding: 1rem;
            }
            
            .control-panel {
                flex-direction: column;
                align-items: center;
            }
            
            button {
                width: 100%;
                max-width: 250px;
                justify-content: center;
            }
            
            .popup {
                max-width: calc(100% - 2rem);
                right: 1rem;
                top: 1rem;
            }
        }

        @media (max-width: 480px) {
            #log {
                font-size: 0.8rem;
            }
        }