* {
    box-sizing: border-box;
}

/* ========== БЛОКИРОВКА СКРОЛЛА СТРАНИЦЫ ========== */

body:has(.clips-page) {
    overflow: hidden !important;
    height: 100vh !important;
    height: 100svh !important;
    height: 100dvh !important;
    height: var(--altn-vh, 100dvh) !important;
}

html:has(.clips-page) {
    overflow: hidden !important;
    height: 100vh !important;
    height: 100svh !important;
    height: 100dvh !important;
    height: var(--altn-vh, 100dvh) !important;
}

.clips-page,
.clips-page *:not(.comments-panel-list) {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

.clips-page::-webkit-scrollbar,
.clips-page *:not(.comments-panel-list)::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* ========== СТРАНИЦА КЛИПОВ ========== */

.clips-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000;
    z-index: 9998;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    height: 100svh;
    height: 100dvh; /* Dynamic viewport height для мобильных */
    height: var(--altn-vh, 100dvh);
}

/* ========== ЗАГОЛОВОК ========== */

.clips-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, transparent 100%);
    padding: max(env(safe-area-inset-top), 20px) 20px 20px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.clips-header.hidden {
    transform: translateY(-100%);
    opacity: 0;
}

.clips-header-content {
    max-width: 450px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.clips-back-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.clips-back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.clips-title {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.clips-title svg {
    flex-shrink: 0;
}

.clips-filters {
    display: flex;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.filter-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-btn:hover {
    color: white;
}

.filter-btn.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* ========== КНОПКА ЗВУКА В ШАПКЕ (ТОЛЬКО МОБИЛЬНЫЕ) ========== */

.clips-header-volume {
    display: none; /* Скрыта по умолчанию */
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 8px 12px;
    flex-shrink: 0;
}

.clips-header-volume-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: all 0.2s ease;
}

.clips-header-volume-btn:active {
    transform: scale(0.9);
}

.clips-header-volume-slider {
    width: 60px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.clips-header-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
}

.clips-header-volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* ========== VIEWPORT И КОНТЕЙНЕР ========== */

.clips-viewport {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100svh;
    height: 100dvh;
    height: var(--altn-vh, 100dvh);
    overflow: hidden;
}

.clips-container {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100svh;
    height: 100dvh;
    height: var(--altn-vh, 100dvh);
    overflow-y: auto;
    overflow-x: hidden;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.clips-container::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

/* ========== ЭЛЕМЕНТ КЛИПА ========== */

.clip-item {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100svh;
    height: 100dvh;
    height: var(--altn-vh, 100dvh);
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    overflow: hidden;
}

.clip-container {
    position: relative;
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    height: 100vh;
    height: 100svh;
    height: 100dvh;
    height: var(--altn-vh, 100dvh);
    background: #000;
    overflow: hidden;
}

.clip-video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    object-fit: contain;
    background: #000;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

/* ========== ИНФОРМАЦИЯ ========== */

.clip-info {
    position: absolute;
    bottom: calc(20px + env(safe-area-inset-bottom));
    left: 16px;
    right: 70px;
    z-index: 10;
    pointer-events: auto;
    transition: bottom 0.3s ease;
}

.clip-container.show-controls .clip-info {
    bottom: calc(90px + env(safe-area-inset-bottom));
}

.clip-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.clip-author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    flex-shrink: 0;
}

.clip-author-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    flex-shrink: 0;
}

.clip-author-details {
    flex: 1;
    min-width: 0;
}

.clip-author-name {
    display: block;
    color: white;
    font-weight: 600;
    font-size: 16px;
    text-decoration: none;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    margin-bottom: 2px;
}

.clip-author-name:hover {
    text-decoration: underline;
}

.clip-author-username {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.clip-follow-btn {
    padding: 8px 20px;
    background: linear-gradient(135deg, #FF0050, #FF4500);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(255, 0, 80, 0.3);
    flex-shrink: 0;
}

.clip-follow-btn:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 0, 80, 0.4);
}

.clip-follow-btn:active {
    transform: scale(0.95);
}

.clip-follow-btn.following {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.clip-follow-btn.following:hover {
    background: rgba(255, 0, 0, 0.2);
    border-color: rgba(255, 0, 0, 0.8);
}

.clip-description {
    color: white;
    font-size: 14px;
    line-height: 1.5;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    margin-bottom: 12px;
    max-height: 80px;
    overflow: hidden;
    word-wrap: break-word;
}

.clip-description.expanded {
    max-height: none;
}

.clip-description-more {
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

/* ========== ПАНЕЛЬ ДЕЙСТВИЙ ========== */

.clip-actions {
    position: absolute;
    right: 12px;
    bottom: calc(100px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    z-index: 30;
}

.clip-action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.clip-action-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: all 0.2s ease;
}

.clip-action-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.clip-action-btn:active {
    transform: scale(0.95);
}

.clip-action-btn.liked {
    background: linear-gradient(135deg, rgba(255, 0, 80, 0.3), rgba(255, 69, 0, 0.3));
    border-color: #FF0050;
}

.clip-action-btn.liked:hover {
    background: linear-gradient(135deg, rgba(255, 0, 80, 0.4), rgba(255, 69, 0, 0.4));
    box-shadow: 0 0 20px rgba(255, 0, 80, 0.5);
}

.clip-action-btn.liked svg {
    fill: #FF0050;
    stroke: #FF0050;
}

.clip-action-btn svg {
    width: 26px;
    height: 26px;
    stroke-width: 2;
}

.clip-action-count {
    color: white;
    font-size: 13px;
    font-weight: 600;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

/* ========== КОНТРОЛЫ ========== */

.clip-controls {
    position: absolute;
    bottom: env(safe-area-inset-bottom);
    left: 0;
    right: 0;
    padding: 16px;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
    z-index: 15;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: auto;
}

.clip-container.show-controls .clip-controls {
    opacity: 1;
}

.clip-progress-bar {
    position: relative;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    cursor: pointer;
    margin-bottom: 10px;
}

.clip-progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: #FF0050;
    border-radius: 2px;
    width: 0%;
    pointer-events: none;
}

.clip-progress-handle {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 12px;
    height: 12px;
    background: #ff0050;
    border: 2px solid #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.clip-progress-bar:hover {
    height: 6px;
}

.clip-controls-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.clip-time {
    color: white;
    font-size: 12px;
    font-weight: 500;
}

.clip-control-buttons {
    display: flex;
    gap: 8px;
}

.clip-control-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: all 0.2s ease;
}

.clip-control-btn:hover {
    background: rgba(52, 152, 219, 0.4);
    border-color: rgba(52, 152, 219, 0.6);
}

.clip-control-btn:active {
    transform: scale(0.9);
}

.clip-control-btn svg {
    width: 18px;
    height: 18px;
}

.clip-volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-slider {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Play/Pause оверлей */
.clip-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(20, 20, 20, 0.8));
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 20;
}

.clip-play-overlay.show {
    opacity: 1;
}

.clip-play-overlay svg {
    width: 28px;
    height: 28px;
    fill: white;
    margin-left: 2px;
}

/* Индикатор загрузки клипа */
.clip-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 25;
}

.clip-loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #FF0050;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== ИНДИКАТОР СКРОЛЛА ========== */

.scroll-indicator {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 30;
}

.scroll-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.scroll-dot.active {
    background: #FF0050;
    transform: scale(1.5);
}

/* ========== ЗАГРУЗЧИК ========== */

.clips-loader {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    z-index: 50;
}

.loader-animation {
    display: flex;
    gap: 12px;
    margin-bottom: 1rem;
    justify-content: center;
}

.loader-circle {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF0050, #FF4500);
    animation: loaderBounce 1.4s infinite ease-in-out;
}

.loader-circle:nth-child(1) { animation-delay: -0.32s; }
.loader-circle:nth-child(2) { animation-delay: -0.16s; }

@keyframes loaderBounce {
    0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* ========== СООБЩЕНИЕ ОБ ОТСУТСТВИИ КЛИПОВ ========== */

.no-clips {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    max-width: 400px;
    padding: 2rem;
}

.no-clips-animation {
    margin-bottom: 1.5rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.no-clips h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.no-clips p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 2rem;
}

.no-clips .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #FF0050, #FF4500);
    color: white;
    border: none;
    border-radius: 24px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.no-clips .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 0, 80, 0.4);
}

.no-clips .btn:active {
    transform: translateY(0);
}

/* ========== ПАНЕЛЬ КОММЕНТАРИЕВ ========== */

.clip-comments-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 450px;
    margin: 0 auto;
    height: 70vh;
    height: 70dvh;
    background: rgba(20, 20, 20, 0.98);
    backdrop-filter: blur(30px);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
    padding-bottom: env(safe-area-inset-bottom);
}

.clip-comments-panel.show {
    transform: translateY(0);
}

.comments-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.comments-panel-header h3 {
    color: white;
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.comments-close-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: all 0.2s ease;
}

.comments-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.comments-close-btn:active {
    transform: rotate(90deg) scale(0.9);
}

.comments-panel-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.comments-panel-list::-webkit-scrollbar {
    width: 4px;
}

.comments-panel-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

/* ========== КОММЕНТАРИИ ========== */

.comment-wrapper {
    margin-bottom: 20px;
}

.clip-comment {
    display: flex;
    gap: 12px;
    animation: commentSlideIn 0.3s ease;
}

@keyframes commentSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.clip-comment-avatar,
.clip-comment-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    cursor: pointer;
}

.clip-comment-avatar {
    object-fit: cover;
}

.clip-comment-avatar-placeholder {
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 700;
}

.clip-comment-content {
    flex: 1;
    min-width: 0;
}

.clip-comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.clip-comment-author {
    color: white;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

.clip-comment-author:hover {
    text-decoration: underline;
}

.clip-comment-time {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
}

.clip-comment-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 8px;
    word-wrap: break-word;
}

.clip-comment-actions {
    display: flex;
    gap: 16px;
}

.clip-comment-action {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    cursor: pointer;
    padding: 0;
    font-weight: 600;
    transition: color 0.2s ease;
}

.clip-comment-action:hover {
    color: white;
}

.clip-comment-action:active {
    transform: scale(0.95);
}

.clip-comment-reply {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    margin-left: 52px;
    margin-top: 12px;
    border-radius: 10px;
    animation: replySlideIn 0.3s ease;
}

@keyframes replySlideIn {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.clip-comment-reply .clip-comment-avatar,
.clip-comment-reply .clip-comment-avatar-placeholder {
    width: 32px;
    height: 32px;
}

.clip-comment-reply .clip-comment-avatar-placeholder {
    font-size: 11px;
}

.clip-comment-reply .clip-comment-text {
    margin-bottom: 4px;
}

.clip-reply-input-wrapper {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.clip-reply-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 10px 16px;
    color: white;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.clip-reply-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.clip-reply-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: #FF0050;
    box-shadow: 0 0 0 3px rgba(255, 0, 80, 0.1);
}

.clip-reply-submit {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF0050, #FF4500);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: all 0.2s ease;
}

.clip-reply-submit:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 0, 80, 0.4);
}

.clip-reply-submit:active {
    transform: scale(0.95);
}

.comments-panel-input {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.comment-input-avatar {
    flex-shrink: 0;
}

.comment-input-avatar img,
.comment-input-avatar .avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.comment-input-avatar .avatar-placeholder {
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 700;
}

.comment-input-field {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 12px 20px;
    color: white;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.comment-input-field::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.comment-input-field:focus {
    border-color: #FF0050;
    background: rgba(255, 255, 255, 0.08);
}

.comment-submit-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF0050, #FF4500);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.comment-submit-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(255, 0, 80, 0.4);
}

.comment-submit-btn:active {
    transform: scale(0.95);
}

.comment-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.comment-submit-btn svg {
    width: 20px;
    height: 20px;
}

.comments-panel-login {
    justify-content: center;
}

.clip-login-comment-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 18px;
    border-radius: 999px;
    background: linear-gradient(135deg, #FF0050, #FF4500);
    color: white;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.clip-login-comment-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 0, 80, 0.35);
}

.comments-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.comments-backdrop.show {
    opacity: 1;
    pointer-events: all;
}

.no-comments {
    text-align: center;
    padding: 3rem 1rem;
    color: rgba(255, 255, 255, 0.5);
}

.no-comments svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-comments p {
    margin: 0;
}

.spinner-small {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

/* ========== АДАПТИВНОСТЬ ========== */

/* Десктоп */
@media (min-width: 769px) {
    .clip-container {
        max-width: 450px;
    }
    
    .scroll-indicator {
        display: flex;
    }
    
    .clips-header-volume {
        display: none !important;
    }
}

/* Планшеты и мобильные */
@media (max-width: 768px) {
    /* Показываем кнопку звука в шапке */
    .clips-header-volume {
        display: flex !important;
    }
    
    /* Скрываем фильтры */
    .clips-filters {
        display: none;
    }
    
    /* Скрываем контроллер звука из нижних контролов */
    .clip-volume-control {
        display: none !important;
    }
    
    .clip-container,
    .clips-header-content,
    .clip-comments-panel {
        max-width: 100%;
    }
    
    .clips-header {
        padding: max(env(safe-area-inset-top), 16px) 16px 16px;
    }
    
    .clips-back-btn {
        width: 36px;
        height: 36px;
    }
    
    .clips-title {
        font-size: 16px;
    }
    
    .clip-info {
        left: 12px;
        right: 64px;
        bottom: calc(16px + env(safe-area-inset-bottom));
    }
    
    .clip-container.show-controls .clip-info {
        bottom: calc(80px + env(safe-area-inset-bottom));
    }
    
    .clip-author {
        gap: 10px;
        margin-bottom: 12px;
    }
    
    .clip-author-avatar,
    .clip-author-placeholder {
        width: 42px;
        height: 42px;
        font-size: 16px;
    }
    
    .clip-author-name {
        font-size: 15px;
    }
    
    .clip-author-username {
        font-size: 13px;
    }
    
    .clip-follow-btn {
        padding: 6px 16px;
        font-size: 13px;
    }
    
    .clip-description {
        font-size: 13px;
        max-height: 70px;
    }
    
    .scroll-indicator {
        display: none;
    }
    
    .clip-actions {
        right: 10px;
        bottom: calc(90px + env(safe-area-inset-bottom));
        gap: 14px;
    }
    
    .clip-action-btn {
        width: 50px;
        height: 50px;
    }
    
    .clip-action-btn svg {
        width: 25px;
        height: 25px;
    }
    
    .clip-controls {
        padding: 14px;
    }
    
    .clip-comment-reply {
        margin-left: 40px;
    }
    
    .comments-panel-header {
        padding: 18px;
    }
    
    .comments-panel-list {
        padding: 14px 18px;
    }
    
    .comments-panel-input {
        padding: 14px 18px;
    }
}

/* Мобильные устройства */
@media (max-width: 480px) {
    .clips-header {
        padding: max(env(safe-area-inset-top), 12px) 12px 12px;
    }
    
    .clips-header-content {
        gap: 0.75rem;
    }
    
    .clips-back-btn {
        width: 34px;
        height: 34px;
    }
    
    .clips-title {
        font-size: 14px;
    }
    
    .clips-title svg {
        width: 20px;
        height: 20px;
    }
    
    .clips-header-volume {
        padding: 6px 10px;
    }
    
    .clips-header-volume-btn {
        width: 28px;
        height: 28px;
    }
    
    .clips-header-volume-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .clips-header-volume-slider {
        width: 50px;
    }
    
    .clip-info {
        left: 10px;
        right: 56px;
        bottom: calc(12px + env(safe-area-inset-bottom));
    }
    
    .clip-container.show-controls .clip-info {
        bottom: calc(70px + env(safe-area-inset-bottom));
    }
    
    .clip-author {
        gap: 8px;
        margin-bottom: 10px;
    }
    
    .clip-author-avatar,
    .clip-author-placeholder {
        width: 38px;
        height: 38px;
        font-size: 14px;
    }
    
    .clip-author-name {
        font-size: 14px;
    }
    
    .clip-author-username {
        font-size: 12px;
    }
    
    .clip-description {
        font-size: 12px;
        max-height: 60px;
    }
    
    .clip-follow-btn {
        padding: 5px 14px;
        font-size: 12px;
    }
    
    .clip-actions {
        right: 8px;
        bottom: calc(80px + env(safe-area-inset-bottom));
        gap: 12px;
    }
    
    .clip-action-btn {
        width: 46px;
        height: 46px;
    }
    
    .clip-action-btn svg {
        width: 23px;
        height: 23px;
    }
    
    .clip-action-count {
        font-size: 11px;
    }
    
    .clip-controls {
        padding: 12px;
    }
    
    .clip-progress-bar {
        margin-bottom: 8px;
    }
    
    .clip-time {
        font-size: 11px;
    }
    
    .clip-play-overlay {
        width: 56px;
        height: 56px;
    }
    
    .clip-play-overlay svg {
        width: 24px;
        height: 24px;
    }
    
    .clip-comment-reply {
        margin-left: 32px;
        margin-top: 10px;
    }
    
    .comments-panel-header {
        padding: 16px;
    }
    
    .comments-panel-header h3 {
        font-size: 16px;
    }
    
    .comments-close-btn {
        width: 36px;
        height: 36px;
    }
    
    .comments-panel-list {
        padding: 12px 16px;
    }
    
    .comments-panel-input {
        padding: 12px 16px;
    }
    
    .comment-input-avatar img,
    .comment-input-avatar .avatar-placeholder {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    .comment-input-field {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .comment-submit-btn {
        width: 40px;
        height: 40px;
    }
    
    .comment-submit-btn svg {
        width: 18px;
        height: 18px;
    }
}

/* Очень маленькие мобильные */
@media (max-width: 360px) {
    .clips-header {
        padding: max(env(safe-area-inset-top), 10px) 10px 10px;
    }
    
    .clips-back-btn {
        width: 32px;
        height: 32px;
    }
    
    .clips-title {
        font-size: 13px;
    }
    
    .clips-title svg {
        width: 18px;
        height: 18px;
    }
    
    .clips-header-volume {
        padding: 5px 8px;
    }
    
    .clips-header-volume-slider {
        width: 40px;
    }
    
    .clip-author {
        gap: 6px;
    }
    
    .clip-author-avatar,
    .clip-author-placeholder {
        width: 34px;
        height: 34px;
        font-size: 13px;
    }
    
    .clip-author-name {
        font-size: 13px;
    }
    
    .clip-author-username {
        font-size: 11px;
    }
    
    .clip-description {
        font-size: 11px;
    }
    
    .clip-follow-btn {
        padding: 4px 12px;
        font-size: 11px;
    }
    
    .clip-actions {
        gap: 10px;
    }
    
    .clip-action-btn {
        width: 42px;
        height: 42px;
    }
    
    .clip-action-btn svg {
        width: 21px;
        height: 21px;
    }
    
    .clip-action-count {
        font-size: 10px;
    }
    
    .clip-comment-reply {
        margin-left: 26px;
    }
}

/* Ландшафтная ориентация на мобильных */
@media (max-height: 500px) and (orientation: landscape) {
    .clips-header {
        padding: max(env(safe-area-inset-top), 8px) 12px 8px;
    }
    
    .clips-back-btn {
        width: 32px;
        height: 32px;
    }
    
    .clips-title {
        font-size: 14px;
    }
    
    .clips-header-volume {
        padding: 5px 8px;
    }
    
    .clips-header-volume-btn {
        width: 26px;
        height: 26px;
    }
    
    .clips-header-volume-slider {
        width: 40px;
    }
    
    .clip-info {
        bottom: calc(10px + env(safe-area-inset-bottom));
    }
    
    .clip-actions {
        bottom: calc(60px + env(safe-area-inset-bottom));
        gap: 10px;
    }
    
    .clip-action-btn {
        width: 40px;
        height: 40px;
    }
    
    .clip-action-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .clip-author {
        margin-bottom: 6px;
    }
    
    .clip-author-avatar,
    .clip-author-placeholder {
        width: 32px;
        height: 32px;
    }
    
    .clip-description {
        max-height: 40px;
        font-size: 11px;
    }
    
    .clip-follow-btn {
        padding: 4px 10px;
        font-size: 11px;
    }
    
    .clip-controls {
        padding: 10px;
    }
}

/* Устройства с вырезом (notch) */
@supports (padding-top: env(safe-area-inset-top)) {
    .clips-header {
        padding-top: max(env(safe-area-inset-top), 20px);
    }
    
    .clip-info {
        bottom: calc(20px + env(safe-area-inset-bottom));
    }
    
    .clip-actions {
        bottom: calc(100px + env(safe-area-inset-bottom));
    }
    
    .clip-controls {
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }
}   

/* ========== ДРОПДАУН МЕНЮ КЛИПА ========== */

.clip-action-item {
    position: relative;
}

.clip-menu-btn {
    position: relative;
}

.clip-action-btn-disabled,
.clip-action-btn[aria-disabled="true"],
.clip-action-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.clip-dropdown-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    max-width: calc(100vw - 16px);
    background: rgba(20, 20, 20, 0.98);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.clip-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.clip-dropdown-menu-floating[data-altn-viewer-menu="clip"] {
    position: fixed;
    right: auto;
    bottom: auto;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
    z-index: 2147483646 !important;
}

.dropdown-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    font-size: 15px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.dropdown-menu-item:first-child {
    border-radius: 12px 12px 0 0;
}

.dropdown-menu-item:last-child {
    border-radius: 0 0 12px 12px;
}

.dropdown-menu-item:only-child {
    border-radius: 12px;
}

.dropdown-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.dropdown-menu-item svg {
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.7);
}

.dropdown-menu-item:hover svg {
    color: white;
}

.dropdown-menu-item-danger {
    color: var(--error-color, #e74c3c);
}

.dropdown-menu-item-danger svg {
    color: var(--error-color, #e74c3c);
}

.dropdown-menu-item-danger:hover {
    background: rgba(231, 76, 60, 0.15);
}

.dropdown-menu-item-danger:hover svg {
    color: var(--error-color, #e74c3c);
}

.dropdown-menu-item-warning {
    color: var(--warning-color, #f39c12);
}

.dropdown-menu-item-warning svg {
    color: var(--warning-color, #f39c12);
}

.dropdown-menu-item-warning:hover {
    background: rgba(243, 156, 18, 0.15);
}

.dropdown-menu-item-warning:hover svg {
    color: var(--warning-color, #f39c12);
}

.dropdown-menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 4px 0;
}

/* ========== МЕНЮ КОММЕНТАРИЕВ ========== */

.clip-comment-content {
    position: relative;
}

.comment-menu-btn {
    position: absolute;
    top: 0;
    right: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.2s ease;
    opacity: 0;
}

.clip-comment:hover .comment-menu-btn,
.clip-comment-reply:hover .comment-menu-btn {
    opacity: 1;
}

.comment-menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.comment-menu-btn.menu-open {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.comment-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 180px;
    background: rgba(20, 20, 20, 0.98);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    margin-top: 4px;
}

.comment-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.comment-dropdown-menu-floating[data-altn-viewer-menu="clip-comment"] {
    position: fixed;
    right: auto;
    bottom: auto;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
    z-index: 2147483646 !important;
}

@media (max-width: 768px) {
    .clip-dropdown-menu {
        min-width: 200px;
    }
    
    .comment-menu-btn {
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .clip-dropdown-menu,
    .comment-dropdown-menu {
        min-width: 180px;
    }
    
    .dropdown-menu-item {
        padding: 10px 14px;
        font-size: 14px;
    }
}
