:root {
    --surface: #ffffff;
    --surface-muted: #f4f6fb;
    --border: #e3e8f2;
    --text-main: #1c2333;
    --text-muted: #5f6b85;
    --primary: #0d47fb;
    --primary-dark: #0a2fa3;
    --accent: #8b5cf6;
    --shadow-soft: 0 20px 45px rgba(15, 23, 42, 0.08);
    --gradient: linear-gradient(135deg, #0d47fb 0%, #8b5cf6 100%);
}

.tool-hero {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.hero-text {
    flex: 1;
    min-width: 260px;
}

.hero-text h1 {
    font-size: 40px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-muted);
    max-width: 640px;
    margin-bottom: 1rem;
    margin-top: 0;
}

.hero-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.hero-pill {
    padding: 8px 16px;
    border: 1px solid var(--primary);
    border-radius: 99px;
    color: var(--primary);
    font-weight: 600;
    font-size: 13px;
    background: rgba(13, 71, 251, 0.05);
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    padding: 32px;
    height: 100%;
    transition: background 0.3s ease, border 0.3s ease;
}

.panel-head {
    margin-bottom: 24px;
}

.tool-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.textarea-wrapper {
    position: relative;
    margin-top: 20px;
}

.textarea-wrapper label {
    font-weight: 600;
    margin-bottom: 10px;
    display: block;
    color: var(--text-muted);
    font-size: 14px;
}

.text-input-modern {
    width: 100%;
    min-height: 320px;
    border-radius: 18px;
    border: 1px solid var(--border);
    padding: 24px;
    font-size: 15px;
    line-height: 1.7;
    background: var(--surface-muted);
    color: var(--text-main);
    transition: border 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    resize: vertical;
    
}

.text-input-modern:focus:not([readonly]) {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(13, 71, 251, 0.15);
}

.text-input-modern[readonly] {
    background: var(--surface-muted);
    cursor: default;
}

.controls-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
}

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

.checkbox-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid var(--border);
    cursor: pointer;
    accent-color: var(--primary);
}

.checkbox-item label {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-main);
    cursor: pointer;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.control-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-main);
    font-size: 15px;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.control-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 71, 251, 0.1);
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
    margin-top: 24px;
}

.btn-action-modern {
    border: none;
    border-radius: 14px;
    padding: 14px 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: inset 0 0 0 1px var(--border);
    background: var(--surface-muted);
    color: var(--text-main);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    cursor: pointer;
    font-size: 15px;
}

.btn-action-modern:hover {
    transform: translateY(-2px);
    background: rgba(13, 71, 251, 0.08);
    box-shadow: 0 4px 12px rgba(13, 71, 251, 0.15);
}

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

.copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface-muted);
    color: var(--text-main);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
    font-size: 0.95rem;
}

.copy-btn:hover {
    background: rgba(13, 71, 251, 0.08);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.copy-btn[data-state="copied"] {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.4);
    color: #059669;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.stat-card {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface-muted);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-main);
}

.sticky-panel {
    position: sticky;
    top: 90px;
}

.tooltip {
    position: relative;
    cursor: help;
    display: inline-flex;
    align-items: center;
}

.tooltip-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    margin-left: 4px;
}

.tooltip .tooltip-content {
    opacity: 0;
    visibility: hidden;
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    color: var(--text-muted);
    white-space: normal;
    transition: opacity 0.2s ease;
    box-shadow: var(--shadow-soft);
    z-index: 10;
    max-width: 250px;
}

.tooltip:hover .tooltip-content,
.tooltip:focus .tooltip-content {
    opacity: 1;
    visibility: visible;
}

.education-block {
    margin-top: 50px;
}

.education-block h2 {
    font-size: 30px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-main);
}

.education-block h3 {
    font-size: 24px;
    font-weight: 700;
    margin-top: 32px;
    margin-bottom: 16px;
    color: var(--text-main);
}

.education-block p {
    font-size: 16px;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 16px;
}

.infographic-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.infographic-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px;
    background: var(--surface-muted);
}

.infographic-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--gradient);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-bottom: 10px;
    font-size: 18px;
}

.infographic-card h5 {
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text-main);
    font-size: 16px;
}

.infographic-card p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
}

.step-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.step-card {
    background: var(--surface-muted);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border);
}

.step-card span {
    display: inline-flex;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient);
    color: #fff;
    font-weight: 700;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    font-size: 16px;
}

.step-card p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
}

.comparison-section {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

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

.comparison-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    background: var(--surface-muted);
}

.comparison-card h5 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-main);
}

.code-block {
    background: #1e293b;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 12px;
    overflow-x: auto;
    
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

.code-block code {
    color: inherit;
    
}

.pug-code {
    color: #e2e8f0;
}

.pug-code code {
    color: #f56565;
}

.result-actions {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.share-container {
    background: rgba(13, 71, 251, 0.08);
    border-radius: 14px;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(13, 71, 251, 0.2);
}

.share-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

.share-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.share-btn {
    border: none;
    border-radius: 14px;
    padding: 12px 16px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #fff;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.15);
    font-size: 14px;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 24px rgba(15, 23, 42, 0.18);
}

.share-btn i {
    font-size: 14px;
}

.share-x {
    background: #111827;
}

.share-facebook {
    background: #1877f2;
}

.share-linkedin {
    background: #0a66c2;
}

.share-reddit {
    background: #ff4500;
}

.share-telegram {
    background: #229ed9;
}

.share-whatsapp {
    background: #25d366;
    color: #0f172a;
}

@media (max-width: 767px) {
    .tool-hero {
        flex-direction: column;
    }

    .hero-text h1 {
        font-size: clamp(1.75rem, 5vw, 2.5rem);
    }

    .hero-subtitle {
        font-size: clamp(1rem, 3vw, 1.125rem);
    }

    .panel {
        padding: 24px;
    }

    .text-input-modern {
        min-height: 240px;
        padding: 18px;
        font-size: 14px;
    }

    .action-buttons {
        grid-template-columns: 1fr;
    }

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

    .copy-btn {
        width: 100%;
    }

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

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

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

    .sticky-panel {
        position: relative;
        top: 0;
    }
}

