/* ===================================
   Material Design 1 Theme - Smotry (Dark)
   =================================== */

/* ===== Variables ===== */
:root {
    --md-primary: #c00000;
    --md-primary-dark: #b30000;
    --md-primary-light: #ff6666;
    --md-accent: #ff3232;
    --md-accent-dark: #c70000;
    
    --md-icons-primary: #ff3232;
    --md-icons-secondary: #ff6666;

    --md-text-primary: rgba(255, 255, 255, 0.87);
    --md-text-secondary: rgba(255, 255, 255, 0.60);
    --md-text-disabled: rgba(255, 255, 255, 0.38);
    --md-text-hint: rgba(255, 255, 255, 0.38);
    
    --md-divider: rgba(255, 255, 255, 0.12);
    --md-background: #121212;
    --md-card-background: #1E1E1E;
    
    --md-shadow-1: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.6);
    --md-shadow-2: 0 3px 6px rgba(0,0,0,0.5), 0 3px 6px rgba(0,0,0,0.7);
    --md-shadow-3: 0 10px 20px rgba(0,0,0,0.6), 0 6px 6px rgba(0,0,0,0.7);
    --md-shadow-4: 0 14px 28px rgba(0,0,0,0.7), 0 10px 10px rgba(0,0,0,0.8);
    --md-shadow-5: 0 19px 38px rgba(0,0,0,0.8), 0 15px 12px rgba(0,0,0,0.8);
}

/* ===== Base Styles ===== */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    background-color: var(--md-background);
    color: var(--md-text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== Material Design App Bar ===== */
.md-app-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background-color: var(--md-primary);
    color: white;
    box-shadow: var(--md-shadow-2);
    z-index: 100;
}

.md-app-bar-row {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 4px;
}

.md-app-bar-section {
    display: flex;
    align-items: center;
    gap: 8px;
}

.md-app-bar-section-start {
    flex-shrink: 0;
}

.md-app-bar-section-center {
    flex: 1;
    justify-content: center;
    max-width: 720px;
    margin: 0 auto;
}

.md-app-bar-section-end {
    flex-shrink: 0;
}

/* ===== Logo ===== */
.md-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: white;
    margin-left: 8px;
}

.md-logo-img {
    height: 28px;
}

/* ===== Material Design Icon Button ===== */
.md-icon-button {
    width: 48px;
    height: 48px;
    padding: 12px;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.md-icon-button:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.md-icon-button:active {
    background-color: rgba(255, 255, 255, 0.25);
}

.md-icon-button .material-icons {
    font-size: 24px;
}

/* ===== Material Design Search Bar ===== */
.md-search-bar {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 640px;
    gap: 8px;
}

.md-search-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    background-color: #2C2C2C;
    border-radius: 2px;
    height: 48px;
    padding: 0 16px;
    box-shadow: var(--md-shadow-1);
    transition: box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.md-search-input-wrapper:focus-within {
    box-shadow: var(--md-shadow-3);
}

.md-search-icon {
    color: var(--md-text-secondary);
    margin-right: 16px;
    cursor: pointer;
    transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.md-search-icon:hover {
    color: var(--md-primary);
}

.md-search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 16px;
    color: var(--md-text-primary);
    font-family: 'Roboto', sans-serif;
}

.md-search-input::placeholder {
    color: var(--md-text-hint);
}

.md-search-clear {
    color: var(--md-text-secondary);
    width: 40px;
    height: 40px;
}

.md-search-button {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
}

.md-search-button:hover {
    background-color: rgba(255, 255, 255, 0.25);
}

/* ===== Material Design FAB ===== */
.md-fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: #00000000;
    color: white;
    border: none;
    box-shadow: var(--md-shadow-2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.md-fab:hover {
    box-shadow: var(--md-shadow-3);
    transform: translateY(-2px);
}

.md-fab:active {
    box-shadow: var(--md-shadow-4);
}

.md-fab-mini {
    width: 40px;
    height: 40px;
}

.md-fab .material-icons {
    font-size: 24px;
}

/* ===== Material Design Navigation Drawer ===== */
.md-drawer {
    position: fixed;
    top: 64px;
    left: 0;
    width: 280px;
    height: calc(100vh - 64px);
    background-color: #1E1E1E;
    box-shadow: var(--md-shadow-2);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 99;
    overflow-y: auto;
}

.md-drawer-open {
    transform: translateX(0);
}

.md-drawer-content {
    padding: 8px 0;
}

.md-drawer-overlay {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 98;
}

.md-drawer-overlay-visible {
    opacity: 1;
    visibility: visible;
}

/* ===== Material Design List ===== */
.md-list {
    padding: 8px 0;
}

.md-list-item {
    display: flex;
    align-items: center;
    padding: 0 16px;
    height: 48px;
    color: var(--md-text-primary);
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.md-list-item:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.md-list-item-active {
    background-color: rgba(255, 50, 50, 0.2);
    color: var(--md-primary);
}

.md-list-item-icon {
    margin-right: 32px;
    color: var(--md-icons-secondary);
}

.md-list-item-active .md-list-item-icon {
    color: var(--md-primary);
}

.md-list-item-text {
    font-size: 14px;
    font-weight: 500;
}

.md-list-subheader {
    padding: 0 16px;
    height: 48px;
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--md-text-secondary);
}

.md-divider {
    height: 1px;
    background-color: var(--md-divider);
    margin: 8px 0;
}

/* ===== Main Content ===== */
.md-content {
    margin-top: 64px;
    padding: 24px;
    min-height: calc(100vh - 64px);
}

.md-container {
    max-width: 1600px;
    margin: 0 auto;
}

/* ===== Material Design Card ===== */
.md-card {
    background-color: var(--md-card-background);
    border-radius: 2px;
    box-shadow: var(--md-shadow-1);
    transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.md-card:hover {
    box-shadow: var(--md-shadow-2);
}

.md-card-content {
    padding: 16px;
}

/* ===== Info Card ===== */
.md-info-card {
    margin-bottom: 24px;
    background-color: #1a2332;
}

.md-info-card .md-card-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.md-info-icon {
    color: var(--md-primary);
    font-size: 24px;
}

.md-info-text {
    font-size: 14px;
    color: var(--md-text-primary);
}

/* ===== Material Design Tabs ===== */
.md-tabs-wrapper {
    width: calc(100% + 48px);
    background-color: var(--md-card-background);
    border-bottom: 1px solid var(--md-divider);
    margin-left: -24px;
    margin-right: -24px;
    margin-bottom: 24px;
}

.md-tabs {
    position: relative;
    display: flex;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 24px;
}

.md-tab {
    padding: 0 24px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    color: var(--md-text-secondary);
    cursor: pointer;
    transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.md-tab:hover {
    color: var(--md-text-primary);
}

.md-tab-active {
    color: var(--md-primary);
}

.md-tab-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 0;
    background-color: var(--md-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.md-tab-active ~ .md-tab-indicator {
    width: 100px;
}

/* ===== Material Design Loading Spinner ===== */
.md-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.md-spinner {
    width: 48px;
    height: 48px;
    animation: md-spinner-rotate 2s linear infinite;
}

.md-spinner-svg {
    width: 100%;
    height: 100%;
}

.md-spinner-path {
    stroke: var(--md-primary);
    stroke-linecap: round;
    animation: md-spinner-dash 1.5s ease-in-out infinite;
}

@keyframes md-spinner-rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes md-spinner-dash {
    0% {
        stroke-dasharray: 1, 200;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 89, 200;
        stroke-dashoffset: -35px;
    }
    100% {
        stroke-dasharray: 89, 200;
        stroke-dashoffset: -124px;
    }
}

.md-loading-text {
    margin-top: 16px;
    font-size: 14px;
    color: var(--md-text-secondary);
}

/* ===== Material Design Videos Grid ===== */
.md-videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

/* ===== Material Design Video Card ===== */
.md-video-card {
    background-color: var(--md-card-background);
    border-radius: 2px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--md-shadow-1);
    transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.md-video-card:hover {
    box-shadow: var(--md-shadow-3);
}

.md-video-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background-color: #2C2C2C;
    overflow: hidden;
}

.md-video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Video duration badge for main page */
.md-video-thumbnail .md-video-duration {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 4px;
    border-radius: 2px;
    font-size: 12px;

    line-height: 1;
    pointer-events: none;
}

.md-video-thumbnail-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    color: var(--md-text-disabled);
}

.md-video-info {
    display: flex;
    gap: 12px;
    padding: 12px;
}

.md-video-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 500;
}

.md-video-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.md-video-details {
    flex: 1;
    min-width: 0;
}

.md-video-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--md-text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.md-video-channel {
    font-size: 13px;
    color: var(--md-text-secondary);
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.md-video-meta {
    font-size: 13px;
    color: var(--md-text-secondary);
}

.md-verified-badge {
    font-size: 16px !important;
    width: 16px;
    height: 16px;
    line-height: 16px;
    color: #00457e;
    vertical-align: middle;
}

.md-video-watched-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    font-size: 11px;
    color: var(--md-text-secondary);
    margin-top: 4px;
}

/* ===== Material Design Button ===== */
.md-button {
    height: 36px;
    min-width: 88px;
    padding: 0 16px;
    border: none;
    border-radius: 2px;
    background-color: transparent;
    color: var(--md-primary);
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.md-button:hover {
    background-color: rgba(255, 50, 50, 0.2);
}

.md-button-raised {
    background-color: var(--md-primary);
    color: white;
    box-shadow: var(--md-shadow-1);
}

.md-button-raised:hover {
    background-color: var(--md-primary-dark);
    box-shadow: var(--md-shadow-2);
}

.md-button-raised:active {
    box-shadow: var(--md-shadow-3);
}

.md-button-icon {
    min-width: 48px;
    width: 48px;
    padding: 0;
    border-radius: 50%;
}

/* ===== Mobile Search Overlay ===== */
.md-mobile-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #121212;
    z-index: 101;
    display: none;
    flex-direction: column;
}

.md-mobile-search-overlay.active {
    display: flex;
}

.md-mobile-search-header {
    display: flex;
    align-items: center;
    height: 64px;
    padding: 0 4px;
    background-color: var(--md-primary);
    box-shadow: var(--md-shadow-2);
}

.md-mobile-search-header .md-icon-button {
    color: white;
}

.md-mobile-search-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    background-color: #2C2C2C;
    border-radius: 2px;
    height: 48px;
    padding: 0 16px;
    margin: 0 8px;
}

.md-mobile-search-input-wrapper .md-icon-button {
    color: var(--md-text-secondary);
    width: 40px;
    height: 40px;
}

.md-mobile-search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 16px;
    color: var(--md-text-primary);
    font-family: 'Roboto', sans-serif;
}

.md-mobile-search-input::placeholder {
    color: var(--md-text-hint);
}

.md-mobile-search-suggestions {
    flex: 1;
    overflow-y: auto;
    background-color: #121212;
}

.md-mobile-search-suggestion {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.md-mobile-search-suggestion:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.md-mobile-search-suggestion .material-icons {
    margin-right: 16px;
    color: var(--md-text-secondary);
}

.md-mobile-search-suggestion-text {
    flex: 1;
    font-size: 14px;
    color: var(--md-text-primary);
}

/* Hide mobile search button on desktop */
#mobileSearchButton {
    display: none;
}

/* ===== Material Design FAB ===== */
@media (max-width: 768px) {
    /* Show mobile search button */
    #mobileSearchButton {
        display: flex;
    }
    
    /* Hide desktop search bar */
    .md-app-bar-section-center {
        display: none;
    }
    
    /* Убираем курсор pointer с иконки поиска в мобильной версии */
    .md-search-icon {
        cursor: default;
    }
    
    .md-search-icon:hover {
        color: var(--md-text-secondary);
    }
    
    .md-app-bar-section-end {
        gap: 0;
        margin-left: auto;
    }
    
    /* Hide other buttons on mobile */
    .md-app-bar-section-end .md-icon-button:not(#mobileSearchButton) {
        display: none;
    }
    
    /* Keep logo visible on mobile */
    .md-logo {
        display: flex;
    }
    
    .md-content {
        padding: 16px;
    }
    
    .md-videos-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 16px;
    }
    
    .md-drawer {
        width: 240px;
    }
}


@media (max-width: 480px) {
    .md-videos-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Material Design Ripple Effect ===== */
.md-ripple {
    position: relative;
    overflow: hidden;
}

.md-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.md-ripple:active::after {
    width: 200px;
    height: 200px;
}

/* ===== Search Page Styles ===== */
.md-search-info {
    margin-bottom: 24px;
}

.md-search-query {
    font-size: 16px;
    color: var(--md-text-primary);
    margin: 0;
}

.md-section-title {
    font-size: 20px;
    font-weight: 500;
    color: var(--md-text-primary);
    margin: 0 0 16px 0;
    padding-top: 8px;
}

/* ===== Channel Cards for Search ===== */
.md-channels-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

.md-channel-card {
    display: flex;
    gap: 16px;
    padding: 16px;
    background-color: var(--md-card-background);
    border-radius: 2px;
    box-shadow: var(--md-shadow-1);
    cursor: pointer;
    transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.md-channel-card:hover {
    box-shadow: var(--md-shadow-2);
}

.md-channel-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background-color: var(--md-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 48px;
    font-weight: 500;
}

.md-channel-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.md-channel-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
}

.md-channel-name {
    font-size: 18px;
    font-weight: 500;
    color: var(--md-text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.md-channel-meta {
    font-size: 14px;
    color: var(--md-text-secondary);
}

.md-channel-description {
    font-size: 14px;
    color: var(--md-text-secondary);
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ===== No Results ===== */
.md-no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.md-no-results-icon {
    font-size: 80px;
    color: var(--md-text-disabled);
    margin-bottom: 16px;
}

.md-no-results h2 {
    font-size: 24px;
    font-weight: 400;
    color: var(--md-text-primary);
    margin: 0 0 8px 0;
}

.md-no-results p {
    font-size: 14px;
    color: var(--md-text-secondary);
    margin: 0;
}

/* ===== Responsive for Search Page ===== */
@media (max-width: 768px) {
    .md-channel-avatar-large {
        width: 80px;
        height: 80px;
        font-size: 32px;
    }
    
    .md-channel-name {
        font-size: 16px;
    }
}

/* Filter Tabs - Material Design 1 Style */
.md-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    letter-spacing: 0.5px;
    bottom: -1px;
}

.md-tab.md-tab-active {
    border-bottom-color: var(--md-primary);
}

@media (max-width: 768px) {
    .md-tab {
        padding: 0 16px;
        font-size: 13px;
    }
}


/* ===== Watch Page Styles ===== */
.md-watch-page {
    padding: 24px 24px 24px 24px;
    background-color: var(--md-background);
}

.md-watch-container {
    max-width: 1600px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 24px;
}

.md-watch-primary {
    min-width: 0;
}

.md-watch-secondary {
    min-width: 0;
}

/* Video Player */
.md-video-player-wrapper {
    background-color: #000;
    border-radius: 2px;
    overflow: hidden;
    box-shadow: var(--md-shadow-2);
    margin-bottom: 16px;
}

/* Video Info */
.md-watch-info {
    background-color: var(--md-card-background);
    padding: 16px;
    border-radius: 2px;
    box-shadow: var(--md-shadow-1);
    margin-bottom: 16px;
}

.md-watch-title {
    font-size: 20px;
    font-weight: 500;
    color: var(--md-text-primary);
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.md-watch-meta {
    font-size: 14px;
    color: var(--md-text-secondary);
    margin-bottom: 16px;
}

/* View count animation */
.view-count-updated {
    animation: viewCountPulse 0.6s ease-out;
    color: var(--md-primary) !important;
    font-weight: 500;
}

@keyframes viewCountPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.md-watch-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

/* Channel Info */
.md-watch-channel {
    background-color: var(--md-card-background);
    padding: 16px;
    border-radius: 2px;
    box-shadow: var(--md-shadow-1);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.md-watch-channel-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.md-watch-channel-details {
    flex: 1;
    min-width: 0;
}

.md-watch-channel-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--md-text-primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.md-watch-channel-name a {
    color: var(--md-text-primary);
    text-decoration: none;
}

.md-watch-channel-name a:hover {
    color: var(--md-primary);
}

.md-watch-channel-subs {
    font-size: 13px;
    color: var(--md-text-secondary);
}

/* Description */
.md-watch-description {
    background-color: var(--md-card-background);
    padding: 16px;
    border-radius: 2px;
    box-shadow: var(--md-shadow-1);
}

.md-watch-description-content {
    font-size: 14px;
    color: var(--md-text-primary);
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.md-watch-description-content p {
    margin: 0 0 12px 0;
}

.md-watch-description-content p:last-child {
    margin-bottom: 0;
}

.md-description-link {
    color: var(--md-primary);
    text-decoration: none;
    word-break: break-all;
    transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.md-description-link:hover {
    color: var(--md-primary-dark);
    text-decoration: underline;
}

.md-description-link:visited {
    color: #7c0000;
}

/* Comments Section */
.md-watch-comments {
    background-color: var(--md-card-background);
    padding: 24px 16px;
    border-radius: 2px;
    box-shadow: var(--md-shadow-1);
    margin-top: 16px;
}

.md-comments-header {
    margin-bottom: 24px;
}

.md-comments-header h3 {
    font-size: 16px;
    font-weight: 500;
    color: var(--md-text-primary);
    margin: 0;
}

.md-comment-form {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
}

.md-comment-avatar {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.md-comment-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.md-comment-input-wrapper {
    flex: 1;
    min-width: 0;
}

.md-comment-input-wrapper textarea {
    width: 100%;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    padding: 8px 0;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    color: var(--md-text-primary);
    background-color: transparent;
    resize: none;
    outline: none;
    transition: border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.md-comment-input-wrapper textarea:focus {
    border-bottom-color: var(--md-primary);
}

.md-comment-input-wrapper textarea::placeholder {
    color: var(--md-text-secondary);
}

.md-comment-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.md-comments-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
}

.md-comment-item {
    display: flex;
    gap: 16px;
    position: relative;
}

/* Reply connection lines */
.md-comment-reply-line {
    position: absolute;
    pointer-events: none;
    z-index: 1;
}

.md-comment-reply-line line {
    stroke: rgba(0, 0, 0, 0.12);
    stroke-width: 2;
}

.md-comment-reply-line circle {
    fill: rgba(0, 0, 0, 0.12);
}

.md-comment-content {
    flex: 1;
    min-width: 0;
}

.md-comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.md-comment-header .material-icons {
    font-size: 20px;   /* любой размер */
}


.md-comment-author {
    font-size: 13px;
    font-weight: 500;
    color: var(--md-text-primary);
    text-decoration: none;
}

.md-comment-author:hover {
    text-decoration: underline;
}

.md-comment-date {
    font-size: 12px;
    color: var(--md-text-secondary);
}

.md-comment-text {
    font-size: 14px;
    color: var(--md-text-primary);
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin-bottom: 8px;
}

.md-comment-actions-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.md-comment-like-button {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--md-text-secondary);
    font-size: 12px;
    border-radius: 2px;
    transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.md-comment-like-button:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.md-comment-like-button .material-icons {
    font-size: 16px;
}

.md-comment-reply-button {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--md-text-secondary);
    font-size: 12px;
    border-radius: 2px;
    transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Roboto', sans-serif;
}

.md-comment-reply-button:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.md-comment-reply-button .material-icons {
    font-size: 16px;
}

.md-comment-reply-form {
    margin-top: 12px;
    padding-left: 0;
}

.md-comment-reply-form .md-comment-input-wrapper {
    width: 100%;
}

.md-comment-reply-form textarea {
    width: 100%;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    padding: 8px 0;
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    color: var(--md-text-primary);
    background-color: transparent;
    resize: none;
    outline: none;
    transition: border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.md-comment-reply-form textarea:focus {
    border-bottom-color: var(--md-primary);
}

.md-comment-reply-form .md-comment-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.md-comment-reaction-active {
    color: #f44336 !important;
}

.md-comment-reaction-active .material-icons {
    color: #f44336 !important;
}

/* Author heart styles */
.md-comment-author-heart {
    font-size: 14px;
    color: #f44336;
    margin-left: 4px;
    animation: heartPulse 0.3s ease-in-out;
}

@keyframes heartPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.md-comment-heart-button {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--md-text-secondary);
    font-size: 12px;
    border-radius: 2px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.md-comment-heart-button:hover {
    background-color: rgba(244, 67, 54, 0.08);
    color: #f44336;
}

.md-comment-heart-button .material-icons {
    font-size: 18px;
}

.md-comment-heart-button.md-comment-hearted {
    color: #f44336;
}

.md-comment-heart-button.md-comment-hearted .material-icons {
    animation: heartPulse 0.3s ease-in-out;
}

/* Pin comment styles */
.md-comment-pin-button {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--md-text-secondary);
    font-size: 12px;
    border-radius: 2px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.md-comment-pin-button:hover {
    background-color: rgba(33, 150, 243, 0.08);
    color: #2196F3;
}

.md-comment-pin-button .material-icons {
    font-size: 18px;
}

.md-comment-pin-button.md-comment-pinned-active {
    color: #2196F3;
}

.md-comment-pinned-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #64B5F6;
    margin-bottom: 8px;
    padding: 4px 8px;
    background-color: rgba(100, 181, 246, 0.15);
    border-radius: 2px;
    width: fit-content;
}

.md-comment-pinned-badge .material-icons {
    font-size: 16px;
}

.md-comment-item.md-comment-pinned {
    background-color: rgba(100, 181, 246, 0.08);
    padding: 12px;
    border-radius: 4px;
    border-left: 3px solid #64B5F6;
}

.md-comments-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--md-text-secondary);
    font-size: 14px;
}

/* Sidebar */
.md-watch-sidebar-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--md-text-primary);
    margin: 0 0 16px 0;
}

.md-watch-recommended {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.md-watch-recommended-item {
    display: flex;
    gap: 8px;
    padding: 8px;
    background-color: var(--md-card-background);
    border-radius: 2px;
    cursor: pointer;
    transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.md-watch-recommended-item:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

/* Playlist Sidebar Header */
.md-playlist-sidebar-header {
    background-color: var(--md-card-background);
    padding: 16px;
    border-radius: 2px;
    box-shadow: var(--md-shadow-1);
    margin-bottom: 16px;
}

.md-playlist-sidebar-title {
    font-size: 18px;
    font-weight: 500;
    color: var(--md-text-primary);
    margin: 0 0 8px 0;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.md-playlist-sidebar-meta {
    font-size: 13px;
    color: var(--md-text-secondary);
    margin-bottom: 4px;
}

.md-playlist-sidebar-meta a {
    color: var(--md-text-primary);
    text-decoration: none;
    font-weight: 500;
}

.md-playlist-sidebar-meta a:hover {
    color: var(--md-primary);
}

.md-playlist-sidebar-count {
    font-size: 13px;
    color: var(--md-text-secondary);
}

/* Playlist Video Item */
.md-playlist-video-item {
    position: relative;
    display: flex;
    gap: 8px;
    padding: 8px;
    background-color: var(--md-card-background);
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
}

.md-playlist-video-item:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.md-playlist-video-item.md-playlist-video-current {
    background-color: rgba(255, 50, 50, 0.15);
    border-left-color: var(--md-primary);
}

.md-playlist-video-index {
    width: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--md-text-secondary);
}

.md-playlist-video-current .md-playlist-video-index {
    color: var(--md-primary);
}

.md-playlist-video-playing {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.md-playlist-video-playing .material-icons {
    color: white;
    font-size: 24px;
}

.md-watch-recommended-thumbnail {
    width: 168px;
    height: 94px;
    flex-shrink: 0;
    background-color: #2C2C2C;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.md-watch-recommended-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Video duration badge */
.md-video-duration {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 4px;
    border-radius: 2px;
    font-size: 12px;

    line-height: 1;
    pointer-events: none;
}

.md-watch-recommended-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.md-watch-recommended-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--md-text-primary);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.md-watch-recommended-channel {
    font-size: 12px;
    color: var(--md-text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: small;
}

.md-watch-recommended-meta {
    font-size: 12px;
    color: var(--md-text-secondary);
}

/* Responsive */
@media (max-width: 1280px) {
    .md-watch-container {
        grid-template-columns: 1fr 350px;
    }
    
    .md-watch-recommended-thumbnail {
        width: 140px;
        height: 79px;
    }
}

@media (max-width: 1024px) {
    .md-watch-container {
        grid-template-columns: 1fr;
    }
    
    .md-watch-secondary {
        max-width: 100%;
    }
    
    .md-watch-recommended {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 16px;
    }
    
    .md-watch-recommended-item {
        flex-direction: column;
    }
    
    .md-watch-recommended-thumbnail {
        width: 100%;
        height: auto;
        padding-top: 56.25%;
    }
    
    .md-watch-recommended-thumbnail img {
        position: absolute;
        top: 0;
        left: 0;
    }
    
    /* Keep playlist items in list format on tablet */
    .md-playlist-video-item {
        display: flex !important;
        flex-direction: column !important;
    }
    
    .md-playlist-video-item .md-watch-recommended-thumbnail {
        width: 100%;
        padding-top: 56.25%;
        position: relative;
    }
    
    /* Slightly smaller buttons on tablets */
    .md-watch-actions .md-button {
        padding: 0 12px;
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    .md-watch-page {
        padding: 16px;
    }
    
    .md-watch-container {
        gap: 16px;
    }
    
    .md-watch-title {
        font-size: 18px;
    }
    
    .md-watch-channel {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .md-watch-channel .md-button {
        width: 100%;
        justify-content: center;
    }
    
    .md-watch-actions {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE and Edge */
        flex-wrap: nowrap;
        width: 100%;
        padding-bottom: 4px;
    }
    
    /* Hide scrollbar for Chrome, Safari and Opera */
    .md-watch-actions::-webkit-scrollbar {
        display: none;
    }
    
    .md-watch-actions .md-button {
        flex-shrink: 0;
        min-width: auto;
        padding: 0 12px;
        font-size: 13px;
        height: 32px;
        gap: 6px;
        white-space: nowrap;
    }
    
    .md-watch-actions .md-button .material-icons {
        font-size: 18px;
    }
    
    /* Reaction buttons stay together */
    .md-watch-reactions {
        flex-shrink: 0;
    }
    
    /* Comments mobile styles */
    .md-watch-comments {
        padding: 16px 12px;
    }
    
    .md-comment-form {
        gap: 12px;
    }
    
    .md-comment-avatar {
        width: 32px;
        height: 32px;
    }
    
    .md-comment-item {
        gap: 12px;
    }
    
    .md-comment-input-wrapper textarea {
        font-size: 13px;
    }
    
    .md-comment-text {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .md-watch-recommended {
        grid-template-columns: 1fr;
    }
    
    /* Playlist items stay in single column on mobile */
    .md-playlist-video-item {
        display: flex !important;
        flex-direction: column !important;
    }
    
    /* Ensure playlist header is readable on mobile */
    .md-playlist-sidebar-header {
        padding: 12px;
    }
    
    .md-playlist-sidebar-title {
        font-size: 15px;
        line-height: 1.3;
    }
    
    /* Even more compact buttons for small phones */
    .md-watch-actions {
        gap: 6px;
    }
    
    .md-watch-actions .md-button {
        padding: 0 10px;
        font-size: 12px;
        height: 30px;
        gap: 4px;
    }
    
    .md-watch-actions .md-button .material-icons {
        font-size: 16px;
    }
    
    /* Make reaction buttons more compact */
    .md-watch-reactions {
        flex-shrink: 0;
    }
    
    .md-reaction-button {
        padding: 0 8px;
        font-size: 12px;
    }
    
    .md-reaction-button .material-icons {
        font-size: 18px;
    }
}

@media (max-width: 360px) {
    /* Extra compact for very small phones */
    .md-watch-actions {
        gap: 6px;
    }
    
    .md-watch-actions .md-button {
        padding: 0 8px;
        font-size: 11px;
        height: 28px;
        gap: 3px;
    }
    
    .md-watch-actions .md-button .material-icons {
        font-size: 14px;
    }
    
    .md-reaction-button {
        padding: 0 6px !important;
        font-size: 11px;
        min-width: 48px;
    }
    
    .md-reaction-button .material-icons {
        font-size: 16px;
    }
    
    .md-watch-title {
        font-size: 16px;
    }
}


/* Active state for like/dislike buttons */
.md-button-active {
    color: var(--md-primary) !important;
    background-color: rgba(255, 50, 50, 0.2) !important;
}

.md-button-active .material-icons {
    color: var(--md-primary);
}


/* Subscribed button state */
.md-button-subscribed {
    background-color: rgba(255, 255, 255, 0.15) !important;
    color: var(--md-text-secondary) !important;
    box-shadow: none !important;
}

.md-button-subscribed:hover {
    background-color: rgba(255, 255, 255, 0.2) !important;
}

/* Channel Page Styles */
.md-channel-banner {
    width: calc(100% + 48px);
    height: 200px;
    background: var(--md-surface);
    overflow: hidden;
    margin-left: -24px;
    margin-right: -24px;
    margin-top: -24px;
    margin-bottom: 0;
}

.md-channel-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.md-channel-header {
    background: var(--md-surface);
    border-bottom: 1px solid var(--md-divider);
    padding: 24px 0 0;
    margin-left: -24px;
    margin-right: -24px;
    padding-left: 24px;
    padding-right: 24px;
}

.md-channel-header-content {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    padding-bottom: 24px;
}

.md-channel-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.md-channel-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.md-channel-header-info {
    flex: 1;
    min-width: 0;
}

.md-channel-header-name {
    font-size: 24px;
    font-weight: 500;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.md-channel-header-meta {
    color: var(--md-text-secondary);
    font-size: 14px;
    margin-bottom: 8px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.md-channel-header-description {
    color: var(--md-text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.md-channel-header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.md-button-subscribed {
    background: var(--md-surface-variant) !important;
    color: var(--md-text-primary) !important;
}

.md-section-title {
    font-size: 20px;
    font-weight: 500;
    margin: 32px 0 16px 0;
    color: var(--md-text-primary);
}

.md-tab-content {
    display: none;
}

.md-tab-content-active {
    display: block;
}

/* Channel About Styles */
.md-channel-about {
    max-width: 800px;
    padding: 24px 0;
}

.md-channel-about-section {
    margin-bottom: 32px;
}

.md-channel-about-section h3 {
    font-size: 16px;
    font-weight: 500;
    margin: 0 0 12px 0;
    color: var(--md-text-primary);
}

.md-channel-about-section p {
    color: var(--md-text-secondary);
    line-height: 1.6;
    margin: 0;
}

.md-channel-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.md-channel-stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--md-text-secondary);
}

.md-channel-stat-item i {
    color: var(--md-text-secondary);
    font-size: 20px;
}

/* Channels Grid (for search results) */
.md-channels-grid {
    display: grid;
    gap: 24px;
    padding: 24px 0;
}

.md-channel-card {
    display: flex;
    gap: 16px;
    padding: 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.md-channel-card:hover {
    background: rgba(255, 255, 255, 0.08);
}

.md-channel-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.md-channel-info {
    flex: 1;
    min-width: 0;
}

.md-channel-name {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.md-channel-meta {
    color: var(--md-text-secondary);
    font-size: 13px;
    margin-bottom: 8px;
}

.md-channel-description {
    color: var(--md-text-secondary);
    font-size: 13px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 768px) {
    .md-channel-banner {
        height: 120px;
    }
    
    .md-channel-header-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .md-channel-header-info {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .md-channel-header-meta {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Smaller video cards for channel home tab */
#homeTab .md-videos-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

#homeTab .md-video-card {
    max-width: 280px;
}

#homeTab .md-video-thumbnail {
    height: 140px;
}

#homeTab .md-video-title {
    font-size: 13px;
    line-height: 1.3;
    -webkit-line-clamp: 2;
}

#homeTab .md-video-channel {
    font-size: 12px;
}

#homeTab .md-video-meta {
    font-size: 12px;
}

#homeTab .md-video-avatar {
    width: 32px;
    height: 32px;
}

@media (max-width: 768px) {
    #homeTab .md-videos-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }
    
    #homeTab .md-video-card {
        max-width: 100%;
    }
    
    #homeTab .md-video-thumbnail {
        height: 100px;
    }
}

/* Video Filters */
.md-video-filters {
    display: flex;
    gap: 8px;
    padding: 16px 0;
    border-bottom: 1px solid var(--md-divider);
    margin-bottom: 16px;
}

.md-filter-button {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--md-text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Roboto', sans-serif;
}

.md-filter-button:hover {
    background: rgba(255, 255, 255, 0.15);
}

.md-filter-button.md-filter-active {
    background: var(--md-primary);
    color: white;
}

@media (max-width: 768px) {
    .md-video-filters {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .md-video-filters::-webkit-scrollbar {
        display: none;
    }
    
    .md-filter-button {
        white-space: nowrap;
        flex-shrink: 0;
    }
}


/* ===== Reaction Buttons (Material Design 1 style) ===== */
.md-watch-reactions {
    display: inline-flex;
    flex-direction: column;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    box-shadow: var(--md-shadow-1);
}

.md-reaction-buttons {
    display: flex;
    align-items: center;
}

.md-reaction-button {
    padding: 8px 16px !important;
    border-radius: 0 !important;
    background: transparent !important;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--md-text-secondary) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    height: 36px;
    min-width: 64px;
}

.md-reaction-button:hover {
    background-color: rgba(255, 255, 255, 0.15) !important;
}

.md-reaction-button.md-button-active {
    color: var(--md-primary) !important;
}

.md-reaction-button.md-button-active .material-icons {
    color: var(--md-primary);
}

.md-reaction-button .material-icons {
    font-size: 20px;
    color: var(--md-text-secondary);
}

.md-reaction-divider {
    width: 1px;
    height: 24px;
    background-color: rgba(255, 255, 255, 0.2);
}

/* ===== Reaction Bar (Like/Dislike ratio) ===== */
.md-reaction-bar {
    width: 100%;
    height: 2px;
    background-color: rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.md-reaction-bar-fill {
    height: 100%;
    background-color: #f1f1f1;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Subscribe Button (YouTube-style) ===== */
.md-button-subscribe {
    background-color: #f1f1f1;
    color: #0f0f0f;
    border: none;
    border-radius: 18px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    font-family: 'Roboto', sans-serif;
    min-width: 110px;
}

.md-button-subscribe:hover {
    background-color: #d9d9d9;
}

.md-button-subscribe.subscribed {
    background-color: rgba(255, 255, 255, 0.1);
    color: #f1f1f1;
}

.md-button-subscribe.subscribed:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.subscribe-text {
    font-weight: 500;
}

/* Dark theme adjustments */
@media (prefers-color-scheme: dark) {
    .md-watch-reactions {
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    .md-reaction-button:hover {
        background-color: rgba(255, 255, 255, 0.15) !important;
    }
    
    .md-reaction-divider {
        background-color: rgba(255, 255, 255, 0.2);
    }
    
    .md-reaction-bar {
        background-color: rgba(255, 255, 255, 0.2);
    }
    
    .md-reaction-bar-fill {
        background-color: #f1f1f1;
    }
    
    .md-button-subscribe {
        background-color: #f1f1f1;
        color: #0f0f0f;
    }
    
    .md-button-subscribe:hover {
        background-color: #d9d9d9;
    }
    
    .md-button-subscribe.subscribed {
        background-color: rgba(255, 255, 255, 0.1);
        color: #f1f1f1;
    }
    
    .md-button-subscribe.subscribed:hover {
        background-color: rgba(255, 255, 255, 0.2);
    }
}

/* ===== Share Modal ===== */
.md-share-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.md-share-modal.active {
    display: flex;
}

.md-share-modal-content {
    background-color: #1E1E1E;
    border-radius: 2px;
    box-shadow: var(--md-shadow-5);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

.md-share-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--md-divider);
}

.md-share-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 500;
    color: var(--md-text-primary);
}

.md-share-modal-header .md-icon-button {
    color: var(--md-text-secondary);
}

.md-share-modal-header .md-icon-button:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.md-share-options {
    display: flex;
    gap: 16px;
    padding: 24px;
    overflow-x: auto;
}

.md-share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    min-width: 80px;
}

.md-share-option-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.md-share-option:hover .md-share-option-icon {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.md-share-option-icon .material-icons {
    font-size: 32px;
    color: var(--md-text-secondary);
}

.md-share-option span {
    font-size: 13px;
    color: var(--md-text-primary);
    text-align: center;
}

.md-share-link-container {
    display: flex;
    gap: 12px;
    padding: 0 24px 24px 24px;
    align-items: center;
}

.md-share-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--md-divider);
    border-radius: 2px;
    font-size: 14px;
    color: var(--md-text-primary);
    background-color: var(--md-background);
    font-family: 'Roboto', sans-serif;
    outline: none;
    transition: border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.md-share-input:focus {
    border-color: var(--md-primary);
}

.md-share-timestamp {
    padding: 0 24px 24px 24px;
}

.md-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.md-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--md-primary);
}

.md-checkbox span {
    font-size: 14px;
    color: var(--md-text-secondary);
}

@media (max-width: 768px) {
    .md-share-modal-content {
        width: 95%;
        max-width: none;
    }
    
    .md-share-modal-header {
        padding: 16px 20px;
    }
    
    .md-share-options {
        padding: 20px;
    }
    
    .md-share-link-container {
        flex-direction: column;
        padding: 0 20px 20px 20px;
    }
    
    .md-share-link-container .md-button {
        width: 100%;
    }
    
    .md-share-timestamp {
        padding: 0 20px 20px 20px;
    }
}




/* ===== Playlist Styles ===== */

/* Page Header */
.md-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 0 4px;
}

.md-page-title {
    font-size: 24px;
    font-weight: 400;
    margin: 0;
    color: var(--md-text-primary);
}

/* Playlist Thumbnail Placeholder */
.md-playlist-thumbnail-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--md-primary) 0%, var(--md-primary-dark) 100%);
}

.md-playlist-thumbnail-placeholder i {
    font-size: 64px;
    color: white;
}

/* Playlist Overlay */
.md-playlist-overlay {
    position: absolute;
    bottom: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 500;
}

.md-playlist-overlay i {
    font-size: 18px;
}

/* Playlist Actions */
.md-playlist-actions {
    display: flex;
    gap: 4px;
    margin-top: 8px;
}

/* Playlist Header Card */
.md-playlist-header-card {
    margin-bottom: 24px;
}

.md-playlist-header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
}

.md-playlist-header-info {
    flex: 1;
}

.md-playlist-header-title {
    font-size: 28px;
    font-weight: 400;
    margin: 0 0 12px 0;
    color: var(--md-text-primary);
}

.md-playlist-header-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--md-text-secondary);
    margin-bottom: 12px;
}

.md-playlist-header-channel {
    color: var(--md-text-primary);
    text-decoration: none;
    font-weight: 500;
}

.md-playlist-header-channel:hover {
    color: var(--md-primary);
}

.md-playlist-header-separator {
    color: var(--md-text-secondary);
}

.md-playlist-header-description {
    font-size: 14px;
    line-height: 1.6;
    color: var(--md-text-secondary);
    margin: 0;
    white-space: pre-wrap;
}

.md-playlist-header-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* Video Remove Button */
.md-video-remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.8);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
    z-index: 2;
}

.md-video-card:hover .md-video-remove-btn {
    opacity: 1;
}

.md-video-remove-btn:hover {
    background: var(--md-primary);
}

.md-video-remove-btn i {
    font-size: 20px;
}

/* Modal Styles */
.md-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.md-modal.active {
    display: flex;
}

.md-modal-content {
    background: #1E1E1E;
    border-radius: 2px;
    box-shadow: var(--md-shadow-5);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.md-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--md-divider);
}

.md-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 500;
    color: var(--md-text-primary);
}

.md-modal-form {
    padding: 24px;
}

.md-form-group {
    margin-bottom: 20px;
}

.md-form-group:last-child {
    margin-bottom: 0;
}

.md-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--md-text-primary);
    margin-bottom: 8px;
}

.md-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--md-divider);
    border-radius: 2px;
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
    color: var(--md-text-primary);
    transition: border-color 0.2s;
}

.md-input:focus {
    outline: none;
    border-color: var(--md-primary);
}

.md-input:hover {
    border-color: rgba(255, 255, 255, 0.3);
}

textarea.md-input {
    resize: vertical;
    min-height: 80px;
}

select.md-input {
    cursor: pointer;
    background: #2C2C2C;
}

.md-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* Empty State */
.md-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 24px;
    text-align: center;
}

.md-empty-icon {
    font-size: 96px;
    color: var(--md-divider);
    margin-bottom: 16px;
}

.md-empty-title {
    font-size: 24px;
    font-weight: 400;
    margin: 0 0 8px 0;
    color: var(--md-text-primary);
}

.md-empty-text {
    font-size: 14px;
    color: var(--md-text-secondary);
    margin: 0 0 24px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .md-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .md-playlist-header-content {
        flex-direction: column;
    }

    .md-playlist-header-actions {
        width: 100%;
    }

    .md-playlist-header-actions button {
        flex: 1;
    }

    .md-modal-content {
        width: 95%;
    }

    .md-modal-header {
        padding: 16px 20px;
    }

    .md-modal-form {
        padding: 20px;
    }
}


/* ===== Playlist Modal Styles ===== */

.md-playlist-item {
    padding: 12px 24px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.md-playlist-item:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.md-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    width: 100%;
}

.md-checkbox-input {
    width: 18px;
    height: 18px;
    margin: 0 12px 0 0;
    cursor: pointer;
    accent-color: var(--md-primary);
}

.md-checkbox-text {
    font-size: 14px;
    color: var(--md-text-primary);
    flex: 1;
}

/* Modal adjustments for playlists */
.md-modal .md-modal-content {
    animation: modalSlideIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.md-modal.active .md-modal-content {
    animation: modalSlideIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}


/* ===== History Page Styles ===== */
.md-history-date-header {
    font-size: 16px;
    font-weight: 500;
    color: var(--md-text-primary);
    padding: 16px 0 8px 0;
    margin-top: 16px;
}

.md-history-date-header:first-child {
    margin-top: 0;
}

.md-history-videos-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.md-history-videos-list .md-watch-recommended-item {
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.md-history-videos-list .md-watch-recommended-item:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

@media (max-width: 768px) {
    .md-history-videos-list .md-watch-recommended-thumbnail {
        width: 140px;
        height: 79px;
    }
}

@media (max-width: 480px) {
    .md-history-videos-list .md-watch-recommended-item {
        flex-direction: column;
    }
    
    .md-history-videos-list .md-watch-recommended-thumbnail {
        width: 100%;
        height: auto;
        padding-top: 56.25%;
        position: relative;
    }
    
    .md-history-videos-list .md-watch-recommended-thumbnail img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}
