/* =========================================================
   СТИЛИ ДЛЯ АДМИНКИ (Метабокс)
   ========================================================= */
.sax-block-item { background: #23282d; border: 1px solid #3c434a; margin-bottom: 20px; border-radius: 6px; color: #fff; }
.sax-block-header { background: #1d2327; padding: 12px 15px; display: flex; align-items: center; gap: 15px; border-radius: 6px 6px 0 0; border-bottom: 1px solid #3c434a; }
.sax-block-number { font-weight: bold; color: #f5a623; font-size: 14px; }
.sax-block-header label { color: #a7aaad; font-size: 13px; }
.sax-layout-select { background: #2c3338; color: #fff; border: 1px solid #8c8f94; padding: 4px 8px; border-radius: 4px; font-size: 13px; }
.sax-remove-block { background: transparent !important; border: none !important; color: #ff4d4d !important; cursor: pointer; font-size: 13px; text-decoration: none; padding: 0 !important; }
.sax-remove-block:hover { color: #ff7777 !important; }
.sax-columns-container { display: flex; gap: 15px; padding: 15px; background: #2c3338; border-radius: 0 0 6px 6px; }
.sax-column { flex: 1; min-width: 0; background: #fff; color: #3c434a; border-radius: 4px; padding: 12px; border: 1px solid #8c8f94; }
.sax-col-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid #f0f0f1; }
.sax-col-header label { font-size: 12px; font-weight: bold; color: #1d2327; text-transform: uppercase; }
.sax-col-type { padding: 3px 6px; border-radius: 3px; border: 1px solid #8c8f94; font-size: 12px; }
.sax-col-input { width: 100%; padding: 8px; border: 1px solid #8c8f94; border-radius: 3px; margin-bottom: 8px; }
.sax-media-upload { width: 100%; text-align: center; }
.sax-add-block { background: #f5a623 !important; border-color: #d4891a !important; color: #000 !important; font-weight: bold !important; padding: 8px 20px !important; font-size: 14px !important; }
.sax-add-block:hover { background: #ffbb3d !important; }
.sax-layout-1-1 .sax-column { flex: 1; }
.sax-layout-2-1 .sax-column:first-child { flex: 2; }
.sax-layout-2-1 .sax-column:last-child { flex: 1; }
.sax-layout-1-2 .sax-column:first-child { flex: 1; }
.sax-layout-1-2 .sax-column:last-child { flex: 2; }
.sax-layout-1-1-1 .sax-column { flex: 1; }

/* =========================================================
   СТИЛИ ДЛЯ ФРОНТЕНДА (Сайт)
   ========================================================= */
.sax-content-blocks { margin: 30px 0; }
.sax-block { display: flex; gap: 20px; margin-bottom: 30px; align-items: stretch; }
.sax-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sax-layout-1-1 .sax-col { flex: 1; }
.sax-layout-2-1 .sax-col:first-child { flex: 2; }
.sax-layout-2-1 .sax-col:last-child { flex: 1; }
.sax-layout-1-2 .sax-col:first-child { flex: 1; }
.sax-layout-1-2 .sax-col:last-child { flex: 2; }
.sax-layout-1-1-1 .sax-col { flex: 1; }
.sax-text { line-height: 1.7; }
.sax-image { height: 100%; display: flex; }
.sax-image img { width: 100%; height: 100%; max-height: 450px; object-fit: cover; display: block; border-radius: 6px; }
.sax-video { width: 100%; height: 100%; }
.sax-video iframe, .sax-video video { width: 100%; height: 100%; aspect-ratio: 16 / 9; display: block; border-radius: 6px; border: none; }
.sax-audio { width: 100%; }
.sax-audio audio { width: 100%; margin-top: 10px; }

/* =========================================================
   НОВЫЙ КАСТОМНЫЙ АУДИО ПЛЕЕР (V5 - Умная бегущая строка)
   ========================================================= */
.sax-col-audio .player-card {
    background: linear-gradient(180deg, #222222 0%, #181818 100%);
    border-radius: 12px;
    border: 1px solid rgba(245, 166, 35, 0.3); 
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.8), inset 0 2px 5px rgba(0, 0, 0, 0.6);
    width: 100%;
    padding: 25px;
    box-sizing: border-box;
    position: relative;
    transition: box-shadow 0.5s ease, border-color 0.5s ease;
}

.sax-col-audio .player-card.is-playing {
    border-color: rgba(245, 166, 35, 0.8); 
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.8), inset 0 2px 5px rgba(0, 0, 0, 0.6), 0 0 25px rgba(245, 166, 35, 0.3); 
    animation: pulse-glow 2s infinite alternate;
}

@keyframes pulse-glow {
    from { box-shadow: inset 0 0 40px rgba(0,0,0,0.8), inset 0 2px 5px rgba(0,0,0,0.6), 0 0 15px rgba(245, 166, 35, 0.1); border-color: rgba(245, 166, 35, 0.5); }
    to { box-shadow: inset 0 0 40px rgba(0,0,0,0.8), inset 0 2px 5px rgba(0,0,0,0.6), 0 0 35px rgba(245, 166, 35, 0.6); border-color: rgba(245, 166, 35, 1); }
}

.sax-col-audio .play-btn {
    width: 55px; height: 55px; border-radius: 50%;
    background: linear-gradient(180deg, #ffbb3d 0%, #f5a623 100%);
    border: 1px solid #d4891a; border-bottom: 4px solid #b87210;
    cursor: pointer; display: flex; justify-content: center; align-items: center;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.5), 0 3px 6px rgba(245, 166, 35, 0.2);
    transition: all 0.1s ease; flex-shrink: 0; padding: 0;
}

.sax-col-audio .play-btn:active { transform: translateY(3px); border-bottom: 1px solid #b87210; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5); }

.sax-col-audio .play-btn::after {
    content: ''; display: block; width: 0; height: 0;
    border-style: solid; border-width: 9px 0 9px 15px;
    border-color: transparent transparent transparent #111;
    margin-left: 5px; filter: drop-shadow(0 1px 1px rgba(255,255,255,0.3));
}

.sax-col-audio .play-btn.is-paused::after {
    border: none; width: 14px; height: 16px;
    border-left: 5px solid #111; border-right: 5px solid #111;
    background: transparent; margin-left: 0;
}

.sax-col-audio .single-player { display: flex; align-items: center; gap: 25px; }
.sax-col-audio .player-center { flex-grow: 1; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }

.sax-col-audio .track-title-wrapper {
    width: 100%; overflow: hidden; white-space: nowrap; margin-bottom: 8px;
    display: flex; align-items: center;
    mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
}

.sax-col-audio .track-title { font-size: 16px; font-weight: 500; color: #e8e8e8; white-space: nowrap; display: inline-block; }
.sax-col-audio .track-title.is-scrolling { animation: marquee linear infinite; }

@keyframes marquee {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

.sax-col-audio .progress-wrapper {
    width: 100%; height: 4px; background: #0a0a0a; border-radius: 2px; cursor: pointer;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.9), inset 0 -1px 1px rgba(255,255,255,0.05); position: relative;
}

.sax-col-audio .progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg, #f5a623, #ffbb3d); border-radius: 2px; box-shadow: 0 0 8px rgba(245, 166, 35, 0.6); pointer-events: none; }
.sax-col-audio .time-display { font-size: 13px; color: #888; font-variant-numeric: tabular-nums; flex-shrink: 0; width: 90px; text-align: right; }
.sax-col-audio .volume-control { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.sax-col-audio .volume-icon { color: #888; font-size: 18px; cursor: pointer; }
.sax-col-audio .volume-slider { -webkit-appearance: none; width: 60px; height: 4px; background: #0a0a0a; border-radius: 2px; outline: none; box-shadow: inset 0 1px 2px rgba(0,0,0,0.8); }
.sax-col-audio .volume-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #f5a623; cursor: pointer; box-shadow: 0 2px 5px rgba(0,0,0,0.5); border: 1px solid #d4891a; }

.sax-col-audio .track-list { list-style: none; margin: 20px -25px -25px -25px; padding: 0; border-top: 1px solid rgba(245, 166, 35, 0.2); max-height: 300px; overflow-y: auto; }
.sax-col-audio .track-list::-webkit-scrollbar { width: 8px; }
.sax-col-audio .track-list::-webkit-scrollbar-track { background: #151515; }
.sax-col-audio .track-list::-webkit-scrollbar-thumb { background: #f5a623; border-radius: 4px; border: 2px solid #151515; }
.sax-col-audio .track-list::-webkit-scrollbar-thumb:hover { background: #ffbb3d; }
.sax-col-audio .track-item { display: flex; align-items: center; padding: 15px 25px; border-bottom: 1px solid #2a2a2a; cursor: pointer; transition: all 0.2s; }
.sax-col-audio .track-item:last-child { border-bottom: none; }
.sax-col-audio .track-item:hover { background: rgba(255, 255, 255, 0.02); box-shadow: inset 0 0 10px rgba(0,0,0,0.5); }
.sax-col-audio .track-item.active { background: rgba(245, 166, 35, 0.05); border-left: 3px solid #f5a623; padding-left: 22px; box-shadow: inset 0 0 15px rgba(245, 166, 35, 0.1); }
.sax-col-audio .track-num { width: 30px; color: #555; font-size: 14px; font-variant-numeric: tabular-nums; }
.sax-col-audio .track-item.active .track-num { color: #f5a623; }
.sax-col-audio .track-item-title { flex-grow: 1; color: #ccc; font-size: 15px; }
.sax-col-audio .track-item.active .track-item-title { color: #f5a623; font-weight: bold; }
.sax-col-audio .track-duration { color: #555; font-size: 13px; font-variant-numeric: tabular-nums; }
.sax-hidden-audio { display: none !important; }

/* =========================================================
   НОВЫЙ БЛОК: СКРИН ТЕЛЕФОНА (Phone Screenshot)
   ========================================================= */
.sax-col-phone {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
}

.sax-phone-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    max-width: 100%;
}

.sax-phone-frame {
    position: relative;
    aspect-ratio: 9 / 19.5; /* Пропорции современного экрана */
    background: #050505; /* Черный корпус */
    box-shadow: 0 20px 50px rgba(0,0,0,0.6), inset 0 0 0 2px #333;
    box-sizing: border-box;
    display: flex;
    border-radius: 40px;
    padding: 6px;
    max-width: 100%;
}

.sax-phone-screen {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
    background: #222;
    border-radius: 34px;
}

.sax-phone-screen img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Заполняет весь экран без искажений */
    display: block;
}

/* Боковые кнопки (громкость и питание) */
.sax-phone-frame::before,
.sax-phone-frame::after {
    content: '';
    position: absolute;
    background: #222;
    border-radius: 2px;
    width: 3px;
}

.sax-phone-frame::before { /* Громкость */
    left: -3px;
    top: 20%;
    height: 45px;
    box-shadow: 0 55px 0 #222; 
}

.sax-phone-frame::after { /* Питание */
    right: -3px;
    top: 25%;
    height: 60px;
}

/* Динамический остров (Notch) */
.sax-phone-notch {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 22px;
    background: #000;
    border-radius: 20px;
    z-index: 10;
}

.sax-phone-caption {
    font-size: 14px;
    color: #a7aaad;
    text-align: center;
    margin-top: 5px;
}

/* =========================================================
   АДАПТИВ (Плеер, блоки, телефон)
   ========================================================= */
@media (max-width: 800px) {
    .sax-block { flex-direction: column; gap: 15px; }
    .sax-col { width: 100% !important; flex: none !important; }
    
    .sax-col-audio .single-player { flex-wrap: wrap; gap: 15px; }
    .sax-col-audio .player-center { order: 3; width: 100%; flex: none; margin-top: 10px; }
    .sax-col-audio .time-display { order: 2; text-align: right; margin-left: auto; }
    .sax-col-audio .volume-control { order: 4; width: 100%; justify-content: flex-end; margin-top: 10px; }
    
    /* Адаптив для телефона: на мобильных делаем его чуть меньше */
    .sax-phone-frame { width: 220px !important; } 
}

/* =========================================================
   АНИМАЦИЯ ПРИ ПРОКРУТКЕ (SCROLL ANIMATION)
   ========================================================= */
.sax-animate {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity, transform;
}

.sax-animate.sax-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Отключаем анимацию для баннера, чтобы он не дергался при загрузке */
.sax-col-banner .sax-animate,
.sax-banners-wrap .sax-block {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
}