/* General Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Disable text selection */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    /* Disable image dragging */
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #059669;
    --warning-color: #d97706;
    --error-color: #dc2626;
    --background: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);

    --primary-dark: #1a49b3;
    --accent: #4a5568;
    --accent-hover: #2d3748;
    --hover-color: rgba(37, 99, 235, 0.05);
    --bg-color: #fff;
    --text-color: #000;
    --border-color: #cbd5e0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    height: 100vh;
    overflow: hidden;
}

/* Home Page Styles */
.home-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.top-bar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.top-bar-left .app-logo {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary-color);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.top-bar-nav {
    display: flex;
    gap: 20px;
}

.nav-btn {
    background: none;
    border: 2px solid transparent;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
}

.nav-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.nav-btn:hover:not(.active) {
    background: rgba(37, 99, 235, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.home-content {
    flex: 1;
    overflow-y: auto;
    padding: 40px 30px;
}

.home-layout {
    display: grid;
    grid-template-columns: 1fr 550px;
    gap: 60px;
    max-width: 1350px;
    margin: 0 auto;
    align-items: center;
}

.app-description {
    color: white;
}

.app-description h2 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.description-text {
    font-size: 18px;
    margin-bottom: 40px;
    opacity: 0.9;
    line-height: 1.7;
}

/* Enhanced Home Page Styles */
.hero-section {
    margin-bottom: 40px;
    text-align: center;
}

.hero-badges {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.badge-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.features-section {
    margin-top: 40px;
}

.features-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #ffd700;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.feature-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 25px;
    border-radius: 12px;
    transition: all 0.3s ease;
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.feature-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.feature-icon {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background: rgba(255, 215, 0, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-icon i {
    font-size: 24px;
    color: #ffd700;
}

.feature-content h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: white;
}

.feature-content p {
    opacity: 0.9;
    font-size: 14px;
    line-height: 1.5;
}

.login-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 100%;
    max-width: 520px;
}

.login-card h3 {
    color: var(--text-primary);
    margin-bottom: 25px;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.help-content {
    flex: 1;
    overflow-y: auto;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    padding: 20px 0;
}

.help-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.help-header {
    text-align: center;
    margin-bottom: 30px;
}

.help-header h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #2563eb;
}

.help-subtitle {
    font-size: 16px;
    color: #64748b;
    margin: 0;
    font-weight: 500;
}

.help-navigation {
    display: none;
}

.help-sections {
    display: grid;
    gap: 20px;
    padding: 20px 0;
}

.help-section {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.help-section:nth-child(odd) {
    background: rgba(248, 250, 252, 0.95);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
}

.section-header h3 {
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #1e293b;
    margin: 0;
}

.difficulty-badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.difficulty-badge.easy {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.difficulty-badge.medium {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.difficulty-badge.advanced {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.section-content {
    color: #334155;
    line-height: 1.7;
}

.step-list {
    display: grid;
    gap: 20px;
}

.step-item {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.step-number {
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #1a1a1a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.step-content h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #ffd700;
}

.step-content p {
    opacity: 0.9;
    line-height: 1.6;
    margin: 0;
}

.help-link {
    color: #60a5fa;
    text-decoration: underline;
}

.help-link:hover {
    color: #93c5fd;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.feature-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.feature-item i {
    font-size: 24px;
    color: #ffd700;
    margin-bottom: 10px;
}

.feature-item h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: white;
}

.feature-item p {
    opacity: 0.8;
    line-height: 1.5;
    margin: 0;
}

.editor-features {
    display: grid;
    gap: 20px;
}

.editor-feature {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #ffd700;
}

.editor-feature h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #ffd700;
}

.editor-feature p {
    opacity: 0.9;
    line-height: 1.6;
    margin: 0;
}

.export-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
}

.export-option {
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.export-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 215, 0, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
}

.export-icon i {
    font-size: 28px;
    color: #ffd700;
}

.export-option h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: white;
}

.export-option p {
    opacity: 0.8;
    line-height: 1.5;
    margin: 0;
}

.storage-info {
    display: grid;
    gap: 20px;
}

.storage-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #60a5fa;
}

.storage-item h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #60a5fa;
}

.storage-item p {
    opacity: 0.9;
    line-height: 1.6;
    margin: 0;
}

.troubleshooting-list {
    display: grid;
    gap: 25px;
}

.trouble-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #f59e0b;
}

.trouble-item h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #f59e0b;
}

.trouble-item ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.trouble-item li {
    padding: 6px 0;
    padding-left: 20px;
    position: relative;
    opacity: 0.9;
    line-height: 1.5;
}

.trouble-item li:before {
    content: "▸";
    position: absolute;
    left: 0;
    color: #f59e0b;
    font-weight: bold;
}

/* Quick Start Styles */
.quick-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 30px;
}

.quick-step {
    background: white;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.quick-step:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #2563eb;
}

.step-icon {
    width: 40px;
    height: 40px;
    background: #2563eb;
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 16px;
}

.step-details h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.step-details h4 i {
    color: #2563eb;
    font-size: 14px;
}

.step-details p {
    color: #475569;
    line-height: 1.6;
    margin: 0;
    font-size: 14px;
}

.example-box {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.feature-tags, .download-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tag, .download-btn {
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.download-btn {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.3);
}

/* Connection Providers */
.connection-providers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.provider-card {
    background: #f8fafc;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.provider-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.provider-header i {
    font-size: 24px;
    color: #2563eb;
}

.provider-header h4 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.provider-details p {
    margin: 8px 0;
    font-family: 'Courier New', monospace;
    background: rgba(0, 0, 0, 0.05);
    padding: 8px 12px;
    border-radius: 6px;
    color: #1e293b;
}

.provider-steps {
    margin: 15px 0;
}

.provider-steps p {
    background: rgba(255, 215, 0, 0.1);
    border-left: 3px solid #ffd700;
    margin: 8px 0;
    color: #1e293b;
    padding: 8px 12px;
}

.help-link-box {
    margin-top: 15px;
}

.help-link-box a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #60a5fa;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 12px;
    background: rgba(96, 165, 250, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(96, 165, 250, 0.3);
    transition: all 0.3s ease;
}

.help-link-box:hover {
    background: rgba(96, 165, 250, 0.2);
    transform: translateY(-2px);
}

/* Extraction Features */
.extraction-features {
    display: grid;
    gap: 25px;
}

.extraction-feature {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #10b981;
}

.feature-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.feature-header i {
    font-size: 20px;
    color: #10b981;
}

.feature-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: white;
    margin: 0;
}

.code-example {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    margin-top: 10px;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.auth-status-examples {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 10px;
}

/* Editor Guide */
.editor-guide {
    display: grid;
    gap: 30px;
}

.editor-step {
    background: rgba(255, 255, 255, 0.05);
    padding: 25px;
    border-radius: 12px;
    border-left: 4px solid #8b5cf6;
}

.editor-step h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #8b5cf6;
}

.tip-box {
    background: rgba(251, 191, 36, 0.1);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(251, 191, 36, 0.3);
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tip-box i {
    color: #fbbf24;
}

.template-examples {
    display: grid;
    gap: 12px;
    margin-top: 15px;
}

.template-example {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.header-categories {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.category-tag {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.preview-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

/* Export Guide */
.export-guide {
    display: grid;
    gap: 30px;
}

.export-method {
    display: flex;
    gap: 20px;
    background: rgba(255, 255, 255, 0.05);
    padding: 25px;
    border-radius: 12px;
    border-left: 4px solid #06b6d4;
}

.export-method .export-icon {
    width: 60px;
    height: 60px;
    background: rgba(6, 182, 212, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.export-method .export-icon i {
    font-size: 24px;
    color: #06b6d4;
}

.export-details h4 {
    font-size: 18px;
    font-weight: 600;
    color: white;
    margin-bottom: 10px;
}

.export-details ul {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

.export-details li {
    padding: 4px 0;
    padding-left: 20px;
    position: relative;
    opacity: 0.9;
}

.export-details li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: bold;
}

.use-case {
    background: rgba(6, 182, 212, 0.1);
    padding: 10px;
    border-radius: 6px;
    border: 1px solid rgba(6, 182, 212, 0.3);
    margin-top: 15px;
}

/* Storage Features */
.storage-features {
    display: grid;
    gap: 25px;
}

.storage-feature {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #f59e0b;
}

.storage-feature h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: #f59e0b;
    margin-bottom: 10px;
}

.storage-benefits, .copy-states {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.benefit, .copy-status {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.copy-status.checked {
    background: rgba(16, 185, 129, 0.3);
}

.copy-status.unchecked {
    background: rgba(107, 114, 128, 0.2);
    color: #6b7280;
    border-color: rgba(107, 114, 128, 0.3);
}

/* Troubleshooting Grid */
.troubleshooting-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.trouble-category {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #ef4444;
}

.trouble-category h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: #ef4444;
    margin-bottom: 15px;
}

.trouble-items {
    display: grid;
    gap: 12px;
}

.trouble-category .trouble-item {
    background: rgba(0, 0, 0, 0.2);
    padding: 12px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.4;
}

.trouble-category .trouble-item strong {
    color: #ffd700;
}

/* Tips Grid */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.tip-card {
    background: rgba(255, 255, 255, 0.08);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.tip-icon {
    font-size: 36px;
    margin-bottom: 15px;
}

.tip-card h4 {
    font-size: 16px;
    font-weight: 600;
    color: white;
    margin-bottom: 15px;
}

.tip-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

.tip-card li {
    padding: 6px 0;
    padding-left: 20px;
    position: relative;
    opacity: 0.9;
    line-height: 1.5;
}

.tip-card li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: #ffd700;
    font-weight: bold;
}

.home-footer {
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 20px;
    color: white;
    font-size: 13px;
}

.help-content .home-footer {
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid #e2e8f0;
    color: #475569;
    padding: 20px 30px;
    margin-top: 40px;
    backdrop-filter: blur(10px);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-links {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.footer-links a {
    color: #ffd700;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 4px 8px;
    border-radius: 4px;
}

.help-content .footer-links a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.footer-links a:hover {
    color: white;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    background: rgba(255, 215, 0, 0.1);
}

.help-content .footer-links a:hover {
    color: #1d4ed8;
    text-shadow: none;
    background: rgba(37, 99, 235, 0.1);
}

/* Encode/Decode Styles */
.encode-decode-container {
    padding: 20px;
    width: 100%;
    max-width: 100%;
}

.encode-decode-container.full-width {
    max-width: 100%;
    width: 100%;
}

.encode-decode-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.encode-decode-header h3 {
    font-size: 24px;
    font-weight: 700;
    color: white;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.encode-decode-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    margin: 0;
}

.encode-decode-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 25px;
    width: 100%;
}

.input-output-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.input-section, .output-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.section-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-actions, .output-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.encode-decode-textarea {
    width: 100%;
    min-height: 250px;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.5;
    transition: all 0.2s;
}

.encode-decode-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.controls-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.encoding-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.main-controls {
    padding: 15px;
    background: var(--background);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.caesar-controls {
    margin-top: 10px;
}

.caesar-controls .form-label {
    margin-bottom: 5px;
    font-size: 14px;
    font-weight: 500;
}

.caesar-controls .form-input {
    width: 80px;
}

.encoding-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.quick-actions {
    border-top: 1px solid var(--border);
    padding-top: 20px;
}

.quick-actions h4 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    background: var(--background);
    color: var(--text-primary);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    white-space: nowrap;
}

.quick-action-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.hash-functions {
    border-top: 1px solid var(--border);
    padding-top: 20px;
}

.hash-functions h4 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hash-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.hash-note {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
    padding: 8px 12px;
    background: rgba(255, 193, 7, 0.1);
    border-radius: 4px;
    border-left: 3px solid #ffc107;
    display: flex;
    align-items: center;
    gap: 6px;
}

@media (max-width: 1024px) {
    .encode-decode-layout {
        grid-template-columns: 1fr;
    }

    .quick-actions-grid {
        grid-template-columns: 1fr;
    }

    .hash-actions {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .encode-decode-container {
        padding: 10px;
    }

    .input-actions, .output-actions {
        flex-direction: column;
    }

    .encoding-actions {
        flex-direction: column;
    }

    .encode-decode-textarea {
        min-height: 150px;
    }
}

.quick-action-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

/* Date Range Filter Styles */
.date-input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    cursor: pointer;
    transition: all 0.2s ease;
}

.date-input-wrapper:hover {
    border-color: var(--primary-color);
}

.date-input-wrapper.disabled {
    background: var(--background);
    border-color: var(--border);
    opacity: 0.6;
    cursor: not-allowed;
}

.date-calendar-icon {
    color: var(--primary-color);
    font-size: 16px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.date-calendar-icon:hover {
    color: var(--primary-dark);
}

.date-input-wrapper.disabled .date-calendar-icon {
    color: var(--text-secondary);
    cursor: not-allowed;
}

.date-picker-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    cursor: pointer;
}

.date-picker-input:disabled {
    cursor: not-allowed;
}

.date-display {
    color: var(--text-primary);
    font-size: 14px;
    flex: 1;
    pointer-events: none;
}

.date-input-wrapper.disabled .date-display {
    color: var(--text-secondary);
}

.date-input-wrapper.has-date .date-display {
    color: var(--success-color);
    font-weight: 500;
}

/* Domain/IP Checker Styles */
.domain-ip-checker-container {
    padding: 20px;
    width: 100%;
    max-width: 100%;
}

.domain-ip-checker-container.full-width {
    max-width: 100%;
    width: 100%;
}

.domain-ip-checker-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 25px;
    width: 100%;
}

.domain-ip-options {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.port-controls {
    margin-top: 10px;
}

.port-controls .form-label {
    margin-bottom: 5px;
    font-size: 14px;
    font-weight: 500;
}

.check-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.bulk-checker {
    border-top: 1px solid var(--border);
    padding-top: 20px;
}

.bulk-checker h4 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bulk-checker .form-input {
    resize: vertical;
    min-height: 80px;
}

.check-history {
    border-top: 1px solid var(--border);
    padding-top: 20px;
}

.check-history h4 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px;
    background: var(--background);
    margin-bottom: 10px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background-color 0.2s;
}

.history-item:last-child {
    border-bottom: none;
}

.history-item:hover {
    background: var(--hover-color);
}

.history-item-info {
    flex: 1;
}

.history-item-domain {
    font-weight: 600;
    color: var(--text-primary);
}

.history-item-type {
    font-size: 12px;
    color: var(--text-secondary);
}

.history-item-time {
    font-size: 12px;
    color: var(--text-secondary);
}

.history-item-actions {
    display: flex;
    gap: 5px;
}

.text-muted {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.result-section {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 15px;
    margin: 10px 0;
}

.result-section h5 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid var(--border);
}

.result-item:last-child {
    border-bottom: none;
}

.result-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.result-value {
    color: var(--text-primary);
    word-break: break-word;
}

.status-online {
    color: #22c55e;
    font-weight: 600;
}

.status-offline {
    color: #ef4444;
    font-weight: 600;
}

.status-unknown {
    color: #f59e0b;
    font-weight: 600;
}

@media (max-width: 1024px) {
    .domain-ip-checker-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .encode-decode-grid {
        grid-template-columns: 1fr;
    }

    .quick-actions-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .footer-links {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .domain-ip-checker-container {
        padding: 10px;
    }

    .check-actions {
        flex-direction: column;
    }
}

.main-app {
    height: 100vh;
    overflow: hidden;
}

.user-info {
    font-size: 14px;
    color: var(--text-secondary);
    margin-left: 15px;
    padding: 5px 10px;
    background: rgba(37, 99, 235, 0.1);
    border-radius: 6px;
}

@media (max-width: 768px) {
    .home-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .top-bar {
        flex-direction: column;
        gap: 15px;
        padding: 20px;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

.container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 10px;
    width: 100%;
    max-width: none;
}

/* Header */
.app-header {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
}

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

.count-badge {
    background: var(--primary-color);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    margin-left: 8px;
}

.app-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-title i {
    margin-right: 10px;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.connection-status.connected {
    background: rgba(40, 167, 69, 0.15);
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.connection-status.disconnected {
    background: rgba(220, 53, 69, 0.15);
    border: 1px solid rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.connection-status.connected .status-indicator {
    background: #28a745;
}

.connection-status.disconnected .status-indicator {
    background: #dc3545;
}

/* Hide text when connected, show only green dot */
.connection-status.connected #connectionText {
    display: none;
}

/* Layout */
.main-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 10px;
    flex: 1;
    overflow: hidden;
    width: 100%;
    max-width: none;
    transition: grid-template-columns 0.3s ease;
}

.main-layout.sidebar-collapsed {
    grid-template-columns: 0px 1fr;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
    max-height: 100%;
    transition: all 0.3s ease;
    width: 300px;
    position: relative;
}

.telegram-profile-section {
    display: flex;
    align-items: center;
    margin-right: 15px;
}

.telegram-profile-image {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #3b82f6;
    object-fit: cover;
    cursor: pointer;
    transition: all 0.3s ease;
}

.telegram-profile-image:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.sidebar.collapsed {
    transform: translateX(-100%);
    opacity: 0;
    width: 0;
    min-width: 0;
    overflow: hidden;
}

.sidebar-toggle {
    position: fixed;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    background: #2d3748;
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    opacity: 0.6;
}

.sidebar-toggle:hover {
    background: #4a5568;
    transform: translateY(-50%) translateX(2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 0.9;
}

.sidebar-toggle.sidebar-open {
    background: #e53e3e;
}

.sidebar-toggle.sidebar-open:hover {
    background: #c53030;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

.main-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: none;
}

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group.compact {
    margin-bottom: 10px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
}

.form-input, .form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--surface);
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #1d4ed8;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #047857;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #475569;
}

.btn-full {
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Progress */
.progress-container {
    margin-top: 16px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.progress-text {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
}

/* Checkboxes */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
}

.checkbox-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
    padding: 20px;
    background: var(--background);
    border-bottom: 1px solid var(--border);
}

.stat-card {
    background: var(--surface);
    padding: 16px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--border);
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Tabs */
.tabs {
    display: flex;
    background: var(--background);
    border-bottom: 1px solid var(--border);
}

.tab-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab-button:hover {
    background: rgba(37, 99, 235, 0.05);
    color: var(--primary-color);
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.tab-content {
    display: none;
    padding: 20px;
}

.tab-content.active {
    display: block;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: var(--background);
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.data-table tr:hover {
    background: rgba(37, 99, 235, 0.02);
}

.sortable-date {
    transition: all 0.2s ease;
}

.sortable-date:hover {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.sortable-date i {
    margin-left: 5px;
    font-size: 12px;
    opacity: 0.7;
}

.action-btn {
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin: 0 2px;
}

.action-btn.preview {
    background: var(--primary-color);
    color: white;
}

.action-btn.download {
    background: var(--success-color);
    color: white;
}

.action-btn.save {
    background: var(--warning-color);
    color: white;
}

.status-pass { color: #22c55e; font-weight: 600; }
.status-fail { color: #ef4444; font-weight: 600; }
.status-none { color: #6b7280; }
.status-warn { color: #f59e0b; font-weight: 600; }
.status-neutral { color: #3b82f6; font-weight: 600; }
.status-present { color: #8b5cf6; font-weight: 600; }
.status-other { color: #64748b; font-weight: 500; }

.copy-status {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}

.copy-checked {
    color: #22c55e;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.copy-unchecked {
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 4px;
}

.category-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--surface);
    border-radius: 8px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
}

.move-section, .bulk-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.move-section label {
    font-weight: 500;
    color: var(--text-secondary);
}

.category-stats {
    display: flex;
    gap: 20px;
    margin: 16px 0;
    padding: 12px;
    background: var(--surface);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.stat-value {
    font-weight: 600;
    color: var(--primary-color);
    background: var(--primary-color-light);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.tab-content {
    display: none;
    padding: 20px;
    flex: 1;
    overflow-y: auto;
    width: 100%;
    max-width: none;
}

/* Extract sections */
.extract-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.extract-section {
    background: var(--background);
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.extract-section h4 {
    margin-bottom: 12px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.extract-textarea {
    width: 100%;
    min-height: 150px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    resize: vertical;
    background: var(--surface);
    color: var(--text-primary);
}

.extract-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    background: var(--border);
    color: var(--text-secondary);
}

.badge.success {
    background: #dcfce7;
    color: var(--success-color);
}

.badge.error {
    background: #fee2e2;
    color: var(--error-color);
}

.badge.warning {
    background: #fef3c7;
    color: var(--warning-color);
}

/* Notifications */
.notifications {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    min-width: 300px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease;
}

.notification.success {
    background: var(--success-color);
}

.notification.error {
    background: var(--error-color);
}

.notification.warning {
    background: var(--warning-color);
}

.notification.info {
    background: var(--primary-color);
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    margin-left: auto;
    opacity: 0.8;
}

.close-btn:hover {
    opacity: 1;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .main-layout {
        grid-template-columns: 1fr;
        position: relative;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 1000;
        background: var(--surface);
        border-right: 1px solid var(--border);
        padding: 20px;
        transform: translateX(-100%);
        width: 280px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-toggle {
        position: fixed;
        top: 50%;
        left: 10px;
        transform: translateY(-50%);
        width: 40px;
        height: 40px;
        background: #2d3748;
        border: none;
        border-radius: 8px;
        color: white;
        cursor: pointer;
        z-index: 1100;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        transition: all 0.3s ease;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }

    .sidebar-toggle:hover {
        background: #4a5568;
        transform: translateY(-50%) translateX(2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }

    .sidebar-toggle.sidebar-open {
        background: #e53e3e;
    }

    .sidebar-toggle.sidebar-open:hover {
        background: #c53030;
    }

    .telegram-profile-section {
        margin-right: 8px;
    }

    .telegram-profile-image {
        width: 28px;
        height: 28px;
    }

    .app-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .extract-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 769px) {
    .sidebar-overlay {
        display: none !important;
    }
}

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

::-webkit-scrollbar-track {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Header Editor Styles */
.header-editor-container {
    width: 100%;
    max-width: none;
    padding: 20px 0;
}

.header-sections {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Email Selection Styles */
.email-selection {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.email-selection .form-group {
    margin-bottom: 0;
}

.email-selection .action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Preview Tabs */
.preview-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.preview-tab-btn {
    padding: 8px 16px;
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    font-size: 14px;
    color: #666;
    transition: all 0.2s ease;
}

.preview-tab-btn.active {
    color: #007bff;
    border-bottom-color: #007bff;
    background: #f8f9fa;
}

.preview-tab-btn:hover {
    background: #f8f9fa;
    color: #007bff;
}

.preview-content {
    position: relative;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.template-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.template-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-select {
    padding: 8px 12px;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: var(--background);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.deletion-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.category-section {
    background: var(--background);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.category-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
}

.category-header input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
}

.category-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
    margin-left: 26px;
}

.category-items label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.category-items label:hover {
    background: var(--hover-color);
}

.category-items input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--primary-color);
}

.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.header-preview-textarea {
    width: 100%;
    height: 300px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 15px;
    background: var(--background);
    color: var(--text-primary);
    resize: vertical;
    margin-top: 10px;
}

.category-toggle:checked + strong {
    color: var(--success-color);
}

/* Modify Section Styles */
.modify-container {
    padding: 20px;
    max-width: 1200px;
}

.modify-section {
    margin-bottom: 30px;
    background: var(--surface);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.field-modify-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin: 15px 0;
}

.field-group {
    display: grid;
    grid-template-columns: 120px 1fr auto;
    gap: 10px;
    align-items: center;
}

.field-group label {
    font-weight: 500;
    color: var(--text-secondary);
}

.apply-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.apply-btn:hover {
    background: var(--primary-hover);
}

/* Custom Templates Styles */
.custom-templates-section {
    margin-top: 20px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #f9f9f9;
}

.custom-template-item {
    margin-bottom: 15px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

.custom-template-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.template-number {
    font-weight: 600;
    color: #2563eb;
}

.custom-template-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.template-field {
    display: flex;
    flex-direction: column;
}

.template-field .form-label {
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 500;
}

.remove-template {
    padding: 4px 8px;
    font-size: 12px;
}

.template-help {
    margin-top: 20px;
    padding: 15px;
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 6px;
}

.template-help h4 {
    margin: 0 0 10px 0;
    color: #0066cc;
    font-size: 14px;
}

.placeholder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
}

.placeholder-item {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

@media (max-width: 768px) {
    .custom-template-fields {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .placeholder-grid {
        grid-template-columns: 1fr;
    }
}

.header-templates {
    margin-bottom: 20px;
}

.parameter-deletion {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #007bff;
}

.parameter-deletion h4 {
    margin-top: 0;
    color: #007bff;
    font-size: 16px;
}

.parameter-deletion small {
    display: block;
    color: #666;
    font-size: 12px;
    margin-top: 4px;
    font-style: italic;
}

.template-btn {
    padding: 8px 12px;
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: monospace;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.template-btn:hover {
    background: #27ae60;
    transform: translateY(-1px);
}

.tag-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.tag-btn {
    padding: 6px 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tag-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.category-selector {
    margin-left: 20px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.category-selector select {
    padding: 5px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-color);
    color: var(--text-color);
}

.category-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0;
}

.category-content {
    margin-top: 20px;
}

.category-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    border: 2px solid var(--border-color);
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(99, 102, 241, 0.05) 100%);
    color: var(--text-primary);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.category-btn.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, #5b21b6 100%);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
}

.category-btn:hover:not(.active) {
    background: linear-gradient(135deg, var(--primary-light) 0%, rgba(99, 102, 241, 0.1) 100%);
    color: var(--primary-color);
    border-color: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.category-btn i {
    font-size: 1.1em;
}

/* Inbox Category - Blue Theme */
.category-btn[data-category="inbox"] {
    border-color: #3b82f6;
}

.category-btn[data-category="inbox"].active {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}

/* Spam Category - Red Theme */
.category-btn[data-category="spam"] {
    border-color: #ef4444;
}

.category-btn[data-category="spam"].active {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
}

/* To Test Category - Green Theme */
.category-btn[data-category="to-test"] {
    border-color: #10b981;
}

.category-btn[data-category="to-test"].active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.category-stats {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    padding: 10px;
    background: var(--card-background);
    border-radius: 6px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 6px;
    margin-bottom: 6px;
}

.stat-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.stat-value {
    font-weight: 600;
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    min-width: 24px;
    text-align: center;
}

.headers-textarea {
    width: 100%;
    height: 200px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 15px;
    background: var(--background);
    color: var(--text);
    resize: vertical;
}

.modify-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

/* Storage Styles */
.storage-container {
    padding: 20px;
    width: 100%;
    max-width: none;
}

.storage-container.full-width {
    width: 100%;
    max-width: none;
}

.storage-info {
    margin: 10px 0;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    font-weight: bold;
    border-left: 4px solid #007bff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Simple Dashboard */
.simple-dashboard {
    display: flex;
    gap: 30px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

.simple-dashboard span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.storage-section {
    margin: 15px 0;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
}

.storage-section h3 {
    color: #495057;
    margin: 0;
    font-size: 16px;
}

.copy-feedback {
    display: inline-block;
    margin-left: 10px;
    color: #28a745;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.copy-feedback.show {
    opacity: 1;
}

.action-btn.copied {
    background-color: #28a745 !important;
    color: white !important;
    transition: all 0.3s ease;
}

.storage-stats {
    display: flex;
    gap: 20px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.storage-stat {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 6px;
    border-left: 3px solid #007bff;
    min-width: 120px;
}

.storage-stat .label {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.storage-stat .value {
    font-size: 18px;
    font-weight: bold;
    color: #495057;
}

.storage-tables {
    display: grid;
    gap: 30px;
    width: 100%;
    max-width: none;
}

.storage-table-section {
    background: var(--surface);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border);
    width: 100%;
    max-width: none;
}

.storage-table-section h4 {
    margin: 0 0 15px 0;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.storage-table-section .table-container {
    max-height: 400px;
    overflow-y: auto;
}

.storage-item {
    background: var(--surface);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.storage-textarea {
    width: 100%;
    height: 150px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 10px;
    background: var(--background);
    color: var(--text);
    resize: vertical;
    margin: 10px 0;
}

.storage-item-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
}

.copy-status {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 500;
}

.copy-status:has(.copy-checkmark.visible) {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.copy-checkmark {
    opacity: 0;
    transition: all 0.3s ease;
    color: #10b981;
    margin-left: 8px;
    transform: scale(0.8);
}

.copy-checkmark.visible {
    opacity: 1;
    transform: scale(1);
}

.storage-tab-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 5px;
    transition: background-color 0.3s;
}

.storage-tab-btn.active {
    background: var(--primary-color);
}

.storage-tab-btn:hover {
    background: var(--primary-color);
}

.template-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
    margin-bottom: 15px;
}

.template-buttons button {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 12px;
}

.template-buttons button:hover {
    background: var(--primary-color);
}

/* Local Storage Styles */
.storage-container {
    padding: 20px;
    width: 100%;
    max-width: none;
}

.storage-container.full-width {
    width: 100%;
    max-width: none;
}

.storage-info {
    margin: 10px 0;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    font-weight: bold;
    border-left: 4px solid #007bff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.storage-tabs {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}

.storage-tab-btn {
    background: var(--surface);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 12px 20px;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.storage-tab-btn.active {
    background: var(--primary-color);
    color: white;
    border-bottom: 2px solid var(--primary-color);
    margin-bottom: -2px;
}

.storage-tab-btn:hover:not(.active) {
    background: var(--hover-color);
    color: var(--primary-color);
}

.storage-tab-content {
    display: none;
    margin-top: 20px;
}

.storage-tab-content.active {
    display: block;
}

.storage-section {
    margin: 15px 0;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
}

.storage-section h3 {
    color: #495057;
    margin: 0;
    font-size: 16px;
}

.storage-stats {
    display: flex;
    gap: 20px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.storage-stat {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 6px;
    border-left: 3px solid #007bff;
    min-width: 120px;
}

.storage-stat .label {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.storage-stat .value {
    font-size: 18px;
    font-weight: bold;
    color: #495057;
}

.copy-feedback {
    display: inline-block;
    margin-left: 10px;
    color: #28a745;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.copy-feedback.show {
    opacity: 1;
}

.action-btn.copied {
    background-color: #28a745 !important;
    color: white !important;
    transition: all 0.3s ease;
}