/* --- CSS Variables & Reset --- */
        :root {
            /* Visual Style Variables */
            --primary-grad: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
            --secondary-grad: linear-gradient(135deg, #3cebd3 0%, #1ddbbd 100%);
            --bg-color: #f8f9fc;
            --glass-bg: rgba(255, 255, 255, 0.95);
            --glass-border: rgba(255, 255, 255, 0.2);
            --shadow-sm: 0 2px 4px rgba(0,0,0,0.02);
            --shadow-md: 0 6px 18px rgba(0,0,0,0.04);
            --shadow-lg: 0 10px 25px rgba(0,0,0,0.08);
            --text-main: #1e293b;
            --text-muted: #64748b;
            --border-color: #e2e8f0;
            --font-family: 'Inter', 'Noto Sans Bengali', sans-serif;

            /* Functional Variables */
            --accent:#2b6cb0;
            --success-color: #28a745;
            --danger-color: #e74a3b;
            --card:#ffffff;
        }

        /* Reset */
        * { margin: 0; padding: 0; box-sizing: border-box; outline: none; }
        
        body {
            font-family: var(--font-family);
            background: var(--bg-color);
            color: var(--text-main);
            line-height: 1.45;
            overflow-x: hidden;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
        }

        .container {
            max-width: 1500px;
            margin: 0 auto;
            padding: 0 5px;
            width: 100%;
            flex: 1;
        }

        /* --- Header Styles --- */
        header {
            position: sticky;
            top: 0;
            z-index: 1050;
            background: var(--glass-bg);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border-bottom: 1px solid var(--border-color);
            padding: 0 24px;
            height: 72px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            border-radius: 0;
            box-shadow: var(--shadow-sm);
        }

        .brand{display:flex;align-items:center;gap:12px;text-decoration:none}
        .brand-info h1{font-size:18px;font-weight:700;color:var(--text-main);line-height:1.2;margin:0}
        .brand-info p{font-size:11px;color:var(--text-muted);margin:0}

        .header-center {
            display: flex;
            align-items: center;
            gap: 16px;
        }

        .balance-badge {
            background: rgba(78, 115, 223, 0.08);
            color: #224abe;
            padding: 6px 14px;
            border-radius: 20px;
            font-weight: 600;
            font-size: 14px;
            border: 1px solid rgba(78, 115, 223, 0.1);
            transition: all 0.3s ease;
        }
        .balance-badge.updated {
            background: rgba(231, 74, 59, 0.1);
            color: #c0392b;
            border-color: rgba(231, 74, 59, 0.2);
        }

        .cta {
            background: var(--primary-grad);
            color: white;
            padding: 8px 18px;
            border-radius: 8px;
            font-weight: 600;
            text-decoration: none;
            transition: all 0.2s;
            box-shadow: 0 4px 10px rgba(78, 115, 223, 0.2);
            border: none;
            display: inline-block;
            text-align: center;
        }
        .cta:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(78, 115, 223, 0.3); color: white; }

        .header-right {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        nav ul {
            display: flex;
            gap: 8px;
            list-style: none;
            margin: 0;
            padding: 0;
        }

        nav a {
            color: var(--text-muted);
            text-decoration: none;
            padding: 8px 12px;
            border-radius: 6px;
            font-size: 14px;
            font-weight: 500;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            height: auto;
        }

        nav a:hover { color: #4e73df; background: rgba(78, 115, 223, 0.05); }

        .user-profile-dropdown {
            position: relative;
            display: flex;
            align-items: center;
        }

        .user-profile {
            width: 40px; height: 40px;
            background: #e0e7ff;
            color: #4338ca;
            border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            font-weight: 700; cursor: pointer;
            position: relative;
            border: 2px solid white;
            box-shadow: 0 0 0 2px #e0e7ff;
            overflow: hidden;
            transition: all 0.2s;
        }

        .user-profile:hover { transform: translateY(-2px); }

        .user-avatar {
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 14px;
        }
        
        .user-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .user-dropdown-menu {
            position: absolute;
            top: 120%;
            right: 0;
            background: white;
            width: 240px;
            border-radius: 12px;
            box-shadow: var(--shadow-lg);
            border: 1px solid var(--border-color);
            opacity: 0;
            visibility: hidden;
            transform: translateY(10px);
            transition: all 0.2s ease;
            z-index: 1100;
            padding: 8px 0;
            overflow: hidden;
        }

        .user-dropdown-menu.active {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }

        .user-dropdown-header {
            padding: 12px 16px;
            border-bottom: 1px solid var(--border-color);
            background: #f8fafc;
            margin-bottom: 4px;
        }

        .user-dropdown-header .user-name {
            font-size: 14px;
            color: var(--text-main);
            font-weight: 600;
        }
        
        .user-dropdown-header .user-email {
            font-size: 12px;
            color: var(--text-muted);
        }
        
        .user-dropdown-header .user-balance {
            font-size: 12px;
            margin-top: 4px;
            color: #4e73df;
            font-weight: 600;
        }

        .user-dropdown-item {
            padding: 10px 16px;
            color: var(--text-main);
            font-size: 14px;
            display: flex;
            align-items: center;
            gap: 10px;
            cursor: pointer;
            transition: background 0.1s;
            text-decoration: none;
        }

        .user-dropdown-item:hover { background: #f1f5f9; }
        .user-dropdown-item i { width: 16px; color: #64748b; }
        .user-dropdown-divider { height: 1px; background: var(--border-color); margin: 4px 0; }

        .mobile-menu-toggle {
            display: none;
            background: none;
            border: none;
            font-size: 20px;
            cursor: pointer;
            color: var(--primary-grad);
        }

        .main-content {
            padding: 20px 0 40px 0;
            max-width: 100%;
            margin: 0 auto;
        }

        .page-title {
            text-align: center;
            margin-bottom: 30px;
            color: var(--text-main);
            font-size: clamp(24px, 4vw, 32px);
            font-weight: 700;
            position: relative;
            padding-bottom: 15px;
        }

        .page-title::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 80px;
            height: 3px;
            background: var(--primary-grad);
        }

        /* Toolbar Statistics */
        .toolbar {
            padding: 15px;
            background: white;
            border-radius: 16px;
            box-shadow: var(--shadow-sm);
            margin-bottom: 20px;
            display: flex;
            justify-content: center;
            align-items: center;
            flex-wrap: wrap;
            gap: 15px;
            border: 1px solid var(--border-color);
        }

        .toolbar-stats {
            display: flex;
            flex-direction: row;
            gap: 5px 25px;
            background: rgba(78, 115, 223, 0.05);
            padding: 10px 25px;
            border-radius: 12px;
            border: 1px solid rgba(78, 115, 223, 0.1);
            width: 100%;
            max-width: 1200px;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
        }

        .toolbar-stat {
            display: flex;
            flex-direction: row;
            align-items: center;
            min-width: 110px;
            gap: 5px;
        }

        .toolbar-stat .stat-label {
            font-size: 13px;
            color: #555;
            margin-bottom: 0;
            font-weight: 500;
            white-space: nowrap;
        }

        .toolbar-stat .stat-value {
            font-size: 15px;
            font-weight: bold;
            color: #4e73df;
            margin-left: 3px;
            min-width: 40px;
        }

        .scroll-speed-control {
            display: flex;
            align-items: center;
            gap: 8px;
            min-width: 140px;
        }
        
        .scroll-slider {
            width: 180px;
            height: 5px;
            background: #ddd;
            outline: none;
            opacity: 0.8;
            transition: opacity 0.2s;
            cursor: pointer;
        }
        .scroll-slider:hover { opacity: 1; }
        .scroll-slider::-webkit-slider-thumb {
            appearance: none;
            width: 14px;
            height: 14px;
            background: #4e73df;
            cursor: pointer;
            border-radius: 50%;
        }
        .scroll-slider::-moz-range-thumb {
            width: 14px;
            height: 14px;
            background: #4e73df;
            cursor: pointer;
            border-radius: 50%;
            border: none;
        }

        /* Main Container - Equal Size Panels */
        .main-container {
            display: flex;
            gap: 20px;
            min-height: 600px;
        }

        /* Preview Panel */
        .preview-panel {
            flex: 1;
            background: white;
            border-radius: 16px;
            box-shadow: var(--shadow-md);
            border: 1px solid var(--border-color);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            max-height: calc(100vh - 10px);
        }

        .panel-header {
            background: var(--primary-grad);
            color: white;
            padding: 12px 20px;
            font-weight: 600;
            font-size: 15px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 10px;
        }

        .panel-header-left {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .font-controls-inline {
            display: flex;
            gap: 8px;
        }

        .header-select {
            padding: 4px 8px;
            border-radius: 6px;
            border: none;
            background: rgba(255, 255, 255, 0.9);
            color: #333;
            font-size: 12px;
            cursor: pointer;
            outline: none;
            font-weight: normal;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }

        .preview-content {
            flex: 1;
            overflow-y: auto;
            padding: 20px;
            background: #f8fafc;
            display: flex;
            flex-direction: column;
            align-items: center;
            scroll-behavior: smooth;
        }

        .preview-content::-webkit-scrollbar {
            width: 8px;
        }
        .preview-content::-webkit-scrollbar-track {
            background: #f1f1f1;
            border-radius: 4px;
        }
        .preview-content::-webkit-scrollbar-thumb {
            background: #4e73df;
            border-radius: 4px;
        }

        /* Typing Panel */
        .typing-panel {
            flex: 1;
            background: white;
            border-radius: 16px;
            box-shadow: var(--shadow-md);
            border: 1px solid var(--border-color);
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .typing-content {
            flex: 1;
            overflow-y: auto;
            padding: 20px;
            background: white;
        }

        .typing-area {
            width: 100%;
            min-height: 500px;
            padding: 20px;
            border: 1px solid var(--border-color);
            border-radius: 8px;
            font-size: 16px;
            line-height: 1.8;
            resize: none;
            outline: none;
            font-family: 'Times New Roman', Times, serif;
            background: white;
            transition: border-color 0.3s;
            box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
        }

        .typing-area:focus {
            border-color: #4e73df;
            box-shadow: 0 0 0 3px rgba(78, 115, 223, 0.1);
        }

        /* File Upload Area */
        .file-upload-area {
            width: 100%;
            max-width: 400px;
            padding: 40px;
            border: 2px dashed #cbd5e1;
            border-radius: 12px;
            text-align: center;
            cursor: pointer;
            transition: all 0.3s;
            background: white;
        }

        .file-upload-area:hover {
            border-color: #4e73df;
            background-color: #eff6ff;
        }

        .file-upload-area i {
            font-size: 48px;
            color: #94a3b8;
            margin-bottom: 15px;
        }

        .file-upload-area p {
            margin: 0;
            color: #64748b;
            font-size: 16px;
        }

        .preview-item {
            max-width: 100%;
            margin-bottom: 20px;
            border-radius: 8px;
            box-shadow: var(--shadow-sm);
        }

        .preview-item img {
            width: 100%;
            height: auto;
            display: block;
            border-radius: 8px;
        }

        .preview-item canvas {
            width: 100%;
            height: auto;
            display: block;
            border-radius: 8px;
            margin-bottom: 10px;
        }

        /* Footer */
        footer {
            margin-top: auto; 
            padding: 20px;
            border-top: 1px solid var(--border-color);
            background: white;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: var(--text-muted);
            text-align: center;
        }

        .footer-container {
            width: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .contact {
            font-size: 14px;
            margin-bottom: 5px;
        }

        .footer-links {
            display: flex;
            gap: 15px;
            font-size: 13px;
            justify-content: center;
            width: 100%;
        }

        .footer-links a {
            color: var(--text-muted);
            text-decoration: none;
            transition: color 0.2s;
        }

        .footer-links a:hover {
            color: #4e73df;
        }

        /* Bottom Action Buttons */
        .bottom-actions {
            display: flex;
            justify-content: center;
            gap: 15px;
            margin-top: 20px;
            padding: 10px;
        }

        .btn-custom {
            padding: 10px 25px;
            font-size: 14px;
            cursor: pointer;
            border: 1px solid #4e73df;
            border-radius: 8px;
            background: white;
            color: #4e73df;
            font-weight: 600;
            transition: all 0.3s;
            display: inline-flex;
            align-items: center;
            gap: 8px;
        }

        .btn-custom:hover {
            background: #4e73df;
            color: white;
            transform: translateY(-2px);
            box-shadow: 0 4px 10px rgba(78, 115, 223, 0.3);
        }
        
        .btn-download {
            background: var(--primary-grad);
            border: none;
            color: white;
        }
        
        .btn-download:hover {
            color: white;
            background: #224abe;
        }

        /* Loading Spinner */
        .loading-spinner {
            display: none;
            width: 20px;
            height: 20px;
            border: 3px solid rgba(255,255,255,.3);
            border-radius: 50%;
            border-top-color: #fff;
            animation: spin 1s ease-in-out infinite;
            margin-right: 10px;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        .btn-loading .loading-spinner {
            display: inline-block;
        }

        /* Notification Toast - Enhanced */
        .notification-toast {
            position: fixed;
            bottom: 30px;
            right: 30px;
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            padding: 16px 24px;
            border-radius: 12px;
            box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
            display: flex;
            align-items: center;
            gap: 12px;
            transform: translateX(150%);
            transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            z-index: 9999;
            border-left: 5px solid #4e73df;
            min-width: 300px;
        }

        .notification-toast.show {
            transform: translateX(0);
        }

        .notification-toast.success { border-left-color: var(--success-color); }
        .notification-toast.error { border-left-color: var(--danger-color); }
        .notification-toast.info { border-left-color: #36b9cc; }

        .notification-icon {
            font-size: 22px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .notification-toast.success .notification-icon { color: var(--success-color); }
        .notification-toast.error .notification-icon { color: var(--danger-color); }
        .notification-toast.info .notification-icon { color: #36b9cc; }

        .notification-content {
            display: flex;
            flex-direction: column;
        }

        .notification-title {
            font-weight: 600;
            font-size: 14px;
            color: var(--text-main);
            margin-bottom: 2px;
        }

        .notification-message {
            font-size: 13px;
            color: var(--text-muted);
            line-height: 1.3;
        }

        /* Profile Modal */
        .profile-modal {
            display: none;
            position: fixed;
            top: 0; left: 0;
            width: 100%; height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            z-index: 2000;
            justify-content: center;
            align-items: center;
            backdrop-filter: blur(4px);
        }
        
        .profile-modal.active {
            display: flex;
        }
        
        .profile-modal-content {
            background-color: white;
            padding: 2rem;
            border-radius: 16px;
            max-width: 500px;
            width: 90%;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
            animation: modalFadeIn 0.3s ease-out;
        }
        
        @keyframes modalFadeIn {
            from { opacity: 0; transform: scale(0.95); }
            to { opacity: 1; transform: scale(1); }
        }
        
        .profile-modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            border-bottom: 1px solid #eee;
            padding-bottom: 15px;
        }
        
        .profile-modal-title {
            font-size: 20px;
            font-weight: 700;
            color: var(--text-main);
        }
        
        .profile-modal-close {
            background: none;
            border: none;
            font-size: 20px;
            cursor: pointer;
            color: #999;
            transition: color 0.2s;
        }
        .profile-modal-close:hover { color: #e74a3b; }
        
        .profile-form {
            display: flex;
            flex-direction: column;
            gap: 15px;
        }
        
        .profile-form input,
        .profile-form textarea {
            padding: 12px 15px;
            border: 1px solid #ddd;
            border-radius: 8px;
            font-family: inherit;
            transition: all 0.3s;
        }
        
        .profile-form input:focus,
        .profile-form textarea:focus {
            border-color: #4e73df;
            box-shadow: 0 0 0 3px rgba(78, 115, 223, 0.1);
            outline: none;
        }
        
        .profile-form button {
            background: var(--primary-grad);
            color: white;
            padding: 12px;
            border: none;
            cursor: pointer;
            border-radius: 8px;
            font-weight: 600;
            transition: all 0.3s;
            margin-top: 10px;
        }
        
        .profile-form button:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(78, 115, 223, 0.3);
        }
        
        .profile-upload {
            position: relative;
            width: 100px;
            height: 100px;
            margin: 0 auto 20px;
        }
        
        .profile-upload img {
            width: 100%;
            height: 100%;
            border-radius: 50%;
            object-fit: cover;
            border: 3px solid #4e73df;
        }
        
        .profile-upload .upload-btn {
            position: absolute;
            bottom: 0;
            right: 0;
            background: #4e73df;
            color: white;
            width: 32px;
            height: 32px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            box-shadow: 0 2px 5px rgba(0,0,0,0.2);
            font-size: 12px;
        }
        
        .profile-upload input[type="file"] { display: none; }

        /* Notification Badge */
        #notif-bell { position: relative; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-muted); }
        #notif-badge {
            position: absolute;
            top: -11px;
            right: -4px;
            background: #dc3545;
            color: #fff;
            font-size: 10px;
            font-weight: 700;
            height: 16px;
            min-width: 16px;
            padding: 0 4px;
            border-radius: 50%;
            display: none; 
            align-items: center;
            justify-content: center;
            line-height: 1.4;
        }

        /* Custom Modal Button Styles */
        .btn-gradient-primary {
            background: var(--primary-grad);
            border: none;
            color: white;
        }
        .btn-gradient-primary:hover {
            background: #224abe;
            color: white;
        }
        .btn-outline-danger {
            border-color: #e74a3b;
            color: #e74a3b;
        }
        .btn-outline-danger:hover {
            background-color: #e74a3b;
            color: white;
        }

        /* Responsive */
        @media (max-width: 992px) {
            .main-container {
                flex-direction: column;
            }
            .preview-panel, .typing-panel {
                min-height: 400px;
            }
            .header-center {
                display: none;
            }
        }

        @media screen and (max-width: 768px) {
            .mobile-menu-toggle {
                display: block;
            }
            
            .header-right {
                position: fixed;
                top: 72px;
                right: -100%;
                width: 70%;
                height: calc(100vh - 72px);
                background: white;
                flex-direction: column;
                align-items: flex-start;
                padding: 20px;
                transition: right 0.3s ease;
                box-shadow: -2px 0 5px rgba(0,0,0,0.1);
                z-index: 999;
                border-left: 1px solid var(--border-color);
            }
            
            .header-right.active {
                right: 0;
            }
            
            .header-right ul {
                flex-direction: column;
                width: 100%;
                gap: 15px;
            }
            
            .header-right a {
                display: block;
                padding: 10px;
                width: 100%;
            }
        }

        @media screen and (max-width: 480px) {
            .toolbar {
                flex-direction: column;
                align-items: stretch;
            }
            .toolbar-stats {
                justify-content: space-between;
                gap: 10px;
            }
        }

        .brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-link {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.logo-img {
  width: 40px;    
  height: 40px;
  object-fit: contain;
  display: block;
  transition: 0.2s ease;
}

.logo-img:hover {
  transform: scale(1.05);
}