/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #1f2937;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 1rem;
    overflow-x: hidden;
    min-width: 0;
}

/* Common widget styles */
.widget {
    width: 100%;
    box-sizing: border-box;
    border-radius: 0.75rem;
    position: relative;
}

.widget-bordered {
    border: 2px solid #e5e7eb;
    transition: border-color 0.2s;
}

.widget-bordered:focus-within {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.widget-padded {
    padding: 1.5rem;
}

.widget-background-white {
    background: #ffffff;
}

.widget-background-light {
    background: #fafafa;
}

.widget-background-dark {
    background: #000;
}

.widget-header {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.widget-header-small {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 2rem;
    font-weight: 700;
    color: #4f46e5;
    margin-bottom: 0.25rem;
}

.logo-icon {
    font-size: 2.5rem;
}

.tagline {
    color: #6b7280;
    font-size: 0.95rem;
}

/* Main content */
.main {
    padding: 2rem 0;
}

.hero {
    text-align: center;
    margin-bottom: 3rem;
    color: white;
}

.hero h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Workspace */
.workspace {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    margin-bottom: 2rem;
    overflow-x: hidden;
    min-width: 0;
}

/* Правая секция */
.right-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0;
    overflow-x: hidden;
}

/* Player workspace */
.player-workspace {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    margin-bottom: 2rem;
}

/* Log section */
.log-section {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 3rem;
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.log-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
}

.log-controls {
    display: flex;
    gap: 0.5rem;
}

.event-log {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.4;
    max-height: 300px;
    overflow-y: auto;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
}

.log-entry {
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.log-time {
    color: #6b7280;
    font-size: 0.75rem;
}

.log-event {
    color: #374151;
    margin-left: 0.5rem;
}

.log-event.error {
    color: #dc2626;
}

.log-event.warning {
    color: #d97706;
}

.log-event.success {
    color: #059669;
}

/* Компактная секция логов */
.log-section-compact {
    margin-top: 1rem;
}

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

.log-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Удалено - используется .widget-header-small */

.event-log-compact {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.4;
    max-height: 180px;
    overflow-y: auto;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
}

.event-log-compact::-webkit-scrollbar {
    width: 8px;
}

.event-log-compact::-webkit-scrollbar-track {
    background: #f9fafb;
    border-radius: 4px;
}

.event-log-compact::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.event-log-compact::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Input section */
.input-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
    overflow-x: hidden;
}

/* Компактный плеер справа сверху */
.player-section-compact {
    width: 100%;
    box-sizing: border-box;
}

.player-section-compact .player-container {
    overflow: hidden;
    aspect-ratio: 16/9;
    max-height: 250px;
}

.player-section-compact .player-header {
    margin-bottom: 0.5rem;
}

.player-section-compact .player-status {
    margin-top: 0.5rem;
}

/* Улучшенные элементы управления плеером */
.player-controls-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background: white;
    color: #374151;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 80px;
}

.btn-control:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    transform: translateY(-1px);
}

.btn-control:active {
    transform: translateY(0);
    background: #f3f4f6;
}

.btn-control .btn-icon {
    font-size: 1rem;
    line-height: 1;
}

.btn-control .btn-text {
    font-weight: 500;
}

/* Play/Pause кнопка */
.btn-play-pause .btn-text {
    position: relative;
}

/* Volume controls */
.volume-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.5rem;
}

.btn-mute {
    min-width: 40px;
    padding: 0.375rem;
    border: none;
    background: transparent;
}

.btn-mute:hover {
    background: #f3f4f6;
    border: none;
}

.btn-mute[data-muted="true"] .btn-icon {
    content: "🔇";
}

/* Volume slider */
.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 80px;
    height: 4px;
    border-radius: 2px;
    background: #e5e7eb;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #4f46e5;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    background: #4338ca;
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #4f46e5;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.volume-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    background: #4338ca;
}

.volume-percentage {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
    min-width: 35px;
    text-align: right;
}

/* Прогресс-бар для плеера - справа от статуса */
.progress-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end; /* Выравниваем по правому краю */
}

.progress-time {
    font-size: 0.8rem;
    color: #111827;
    font-weight: 600;
    font-family: monospace;
    white-space: nowrap;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 200px; /* Минимальная ширина для прогресс-бара */
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4f46e5, #7c3aed);
    width: 0%;
    border-radius: 3px;
    transition: width 0.2s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    opacity: 0;
    transition: opacity 0.2s;
}

.progress-bar:hover .progress-fill::after {
    opacity: 1;
}

.progress-percentage {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 600;
    min-width: 35px;
    text-align: right;
    font-family: monospace;
}

/* Tracking section */
.tracking-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
    width: 100%;
    overflow: visible; /* Позволяем контенту определять свои границы скролла */
}

.tracking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Удалено - используется .widget-header */

.tracking-diagram {
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.5rem;
    height: 180px;
    background: #f9fafb;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scroll-padding: 20px;
    width: 100%;
    position: relative;
    scrollbar-width: none; /* Скрываем скроллбар в Firefox */
}

.tracking-diagram::-webkit-scrollbar {
    display: none; /* Полностью скрываем скроллбар в WebKit браузерах */
}

/* Убеждаемся что flow-chart может прокручиваться */
.flow-chart {
    scroll-behavior: smooth;
    position: relative;
    min-width: max-content; /* Гарантируем что контент не сжимается */
}

/* Flow Chart Styles */
.flow-chart {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    min-width: max-content; /* Обеспечиваем что контент не сжимается */
    padding: 1rem 0;
    white-space: nowrap; /* Предотвращаем перенос элементов */
}

.flow-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0; /* Предотвращаем сжатие элементов */
}

.flow-node {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 0.75rem;
    text-align: center;
    min-width: 120px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.flow-node.success {
    border-color: #10b981;
    background: #10b981;
    color: white;
    animation: successPulse 0.6s ease-out;
}

.flow-node.success .flow-node-name,
.flow-node.success .flow-node-status {
    color: white;
}

@keyframes successPulse {
    0% {
        background: #f0fdf4;
        transform: scale(1);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    }
    100% {
        background: #10b981;
        transform: scale(1);
        box-shadow: 0 4px 8px rgba(16, 185, 129, 0.2);
    }
}

.flow-node.error {
    border-color: #ef4444;
    background: #fef2f2;
}

.flow-node.pending {
    border-color: #f59e0b;
    background: #fffbeb;
}

.flow-node.active {
    border-color: #3b82f6;
    background: #dbeafe;
    animation: activePulse 1.5s ease-in-out infinite;
    position: relative;
}

.flow-node.active::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #3b82f6, #1d4ed8, #3b82f6);
    border-radius: 0.75rem;
    z-index: -1;
    animation: activeGlow 2s ease-in-out infinite;
}

@keyframes activePulse {
    0%, 100% {
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
        transform: scale(1.02);
    }
}

@keyframes activeGlow {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.6;
    }
}

/* Подсветка при автоскролле */
.flow-node.highlight-scroll {
    transform: scale(1.08);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.6);
    z-index: 10;
    position: relative;
    transition: all 0.6s ease-out;
}

.flow-node.highlight-scroll::after {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    background: linear-gradient(45deg, #4f46e5, #7c3aed, #06b6d4, #4f46e5);
    border-radius: 1rem;
    z-index: -1;
    animation: highlightPulse 1.5s ease-in-out infinite;
}

@keyframes highlightPulse {
    0%, 100% {
        opacity: 0.4;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.02);
    }
}

.flow-node-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.flow-node-name {
    font-weight: 600;
    font-size: 0.75rem;
    color: #374151;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.flow-node-status {
    font-size: 0.7rem;
    color: #6b7280;
    font-style: italic;
}

.flow-arrow {
    color: #9ca3af;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 0.25rem;
}

/* Extra Events - статические без скролла */
.flow-extra-events {
    padding-top: 1rem;
    position: static;
    overflow: visible;
    min-height: 120px; /* Запас на потенциальные события */
}

.extra-events-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
    display: block; /* Показываем всегда */
}

.extra-events-container {
    display: flex;
    flex-wrap: nowrap; /* Не переносим элементы на новую строку */
    gap: 0.5rem;
    position: static;
    overflow-x: auto; /* Горизонтальный скролл */
    overflow-y: hidden;
    max-height: none;
    padding: 0.5rem 0;
    scroll-behavior: smooth;
    scroll-padding: 10px;
    scrollbar-width: none; /* Скрываем скроллбар в Firefox */
}

.extra-events-container::-webkit-scrollbar {
    display: none; /* Полностью скрываем скроллбар в WebKit браузерах */
}

.extra-event {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    transition: all 0.2s;
    flex-shrink: 0; /* Не позволяем сжиматься */
    white-space: nowrap; /* Не переносим текст */
    min-width: fit-content; /* Минимальная ширина по содержимому */
}

.extra-event.success {
    border-color: #10b981;
    background: #f0fdf4;
}

.extra-event.error {
    border-color: #ef4444;
    background: #fef2f2;
}

.extra-event-icon {
    font-size: 1rem;
}

.extra-event-name {
    font-weight: 500;
    color: #374151;
}

.input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Удалено - используется .widget-header */

.input-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.sample-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.sample-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background: white;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.sample-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.sample-btn.active {
    background: #4f46e5;
    color: white;
    border-color: #4f46e5;
}

.sample-btn:active {
    transform: translateY(1px);
}



.test-options {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.test-options label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: #6b7280;
    cursor: pointer;
}

/* Syntax Editor Container */
.syntax-editor-container {
    height: 300px;
    overflow: hidden;
    min-width: 0;
    max-width: 100%;
}

.syntax-editor-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    overflow: hidden;
    min-width: 0;
    max-width: 100%;
}

#vastInput {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 1rem;
    margin: 0;
    border: none;
    outline: none;
    background: transparent;
    color: transparent;
    caret-color: #333;
    z-index: 2;
    overflow: auto;
    resize: none;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    box-sizing: border-box;
}

#vastInput::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

#vastInput::-webkit-scrollbar-track {
    background: transparent;
}

#vastInput::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

#vastInput::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.5);
}

/* Syntax Highlighting Styles */
.syntax-highlight {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 1rem;
    border: none;
    background: transparent !important;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    box-sizing: border-box;
}

.syntax-highlight::-webkit-scrollbar {
    display: none;
}

.syntax-highlight code {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    white-space: inherit;
    word-wrap: inherit;
    display: block;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
}

/* Custom Prism theme colors for better contrast */
.syntax-highlight .token.tag {
    color: #0078d4;
}

.syntax-highlight .token.attr-name {
    color: #e36209;
}

.syntax-highlight .token.attr-value {
    color: #032f62;
}

.syntax-highlight .token.punctuation {
    color: #5e6687;
}

.syntax-highlight .token.comment {
    color: #6a737d;
    font-style: italic;
}

.syntax-highlight .token.cdata {
    color: #032f62;
}

/* Убираем нумерацию строк пока что, чтобы сначала исправить основную функциональность */

.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Player section */
.player-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
    overflow-x: hidden;
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Удалено - используется .widget-header */

.player-controls-header {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.volume-select {
    padding: 0.25rem 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.8rem;
    background: white;
}

.player-container {
    overflow: hidden;
    aspect-ratio: 16/9;
}

.video-container {
    position: relative;
    width: 100%;
    height: 100%;
}

#contentPlayer {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

#adContainer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.player-status {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

.status-item {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.status-label {
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 500;
}

.status-value {
    font-size: 0.8rem;
    color: #111827;
    font-weight: 600;
    font-family: monospace;
}

/* Ad overlay */
.ad-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10;
}

.ad-content {
    position: relative;
    width: 100%;
    height: 100%;
}

.ad-video-container {
    width: 100%;
    height: 100%;
}

#adVideo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ad-controls {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.skip-btn {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.skip-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

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

/* Player controls */
.player-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 0.5rem;
}

.control-btn {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: none;
    background: #4f46e5;
    color: white;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.control-btn:hover {
    background: #4338ca;
}

.progress-container {
    flex: 1;
}

.progress-bar {
    height: 0.25rem;
    background: #e5e7eb;
    border-radius: 0.125rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #4f46e5;
    width: 0%;
    transition: width 0.1s;
}

.time-display {
    font-size: 0.875rem;
    color: #6b7280;
    min-width: 5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: #4f46e5;
    color: white;
}

.btn-primary:hover {
    background: #4338ca;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-ghost {
    background: transparent;
    color: #6b7280;
}

.btn-ghost:hover {
    background: #f3f4f6;
    color: #374151;
}

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

.btn-icon {
    font-size: 0.75rem;
}

/* Status */
.status {
    font-size: 0.875rem;
    padding: 0.25rem 0;
}

.status.success {
    color: #059669;
}

.status.error {
    color: #dc2626;
}

.status.warning {
    color: #d97706;
}

/* Info section */
.info-section {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.info-section h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
    color: #111827;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.info-card {
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.info-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.info-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #111827;
}

.info-card p {
    color: #6b7280;
    line-height: 1.6;
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1.5rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    color: #6b7280;
}

.version-info {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    margin-top: 1rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.version-info span {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

@media (max-width: 768px) {
    .version-info {
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .workspace {
        grid-template-columns: 1fr;
        padding: 1rem;
        display: flex;
        flex-direction: column;
    }
    
    /* Порядок элементов в мобильной версии: редактор, видео, логи, трекеры */
    .syntax-editor-container {
        order: 1;
    }
    
    .player-section-compact {
        order: 2;
    }
    
    .log-section-compact {
        order: 3;
    }
    
    .tracking-section {
        order: 4;
    }
    
    .input-actions {
        order: 1.5; /* Кнопки после редактора */
    }
    
    .input-section h3 {
        order: 0.5; /* Заголовок в самом начале */
    }
    
    .sample-buttons {
        order: 0.8; /* Примеры кнопок после заголовка */
    }
    
    .input-section {
        display: flex;
        flex-direction: column;
    }
    
    .right-section {
        display: flex;
        flex-direction: column;
    }
    
    .tracking-diagram {
        min-height: 250px;
        padding: 1rem;
    }
    
    .flow-node {
        min-width: 100px;
        padding: 0.5rem;
    }
    
    .flow-node-name {
        font-size: 0.7rem;
    }
    
    .flow-node-icon {
        font-size: 1.25rem;
    }
    
    .flow-arrow {
        font-size: 1.25rem;
        margin: 0 0.125rem;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .input-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .input-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .syntax-editor-container {
        height: 250px;
    }
    
    .input-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(79, 70, 229, 0.3);
    border-radius: 50%;
    border-top-color: #4f46e5;
    animation: spin 1s ease-in-out infinite;
}

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

/* Fade transitions */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
