:root {
    --tt-base-background: #0f0f0f;
    --tt-general-background: #ffffff;
    --tt-brand-background: #212121;
    --tt-text-primary: #f1f1f1;
    --tt-text-secondary: #aaaaaa;
    --tt-themed-blue: #3ea6ff;
    --tt-error: #ff4e45;
    --tt-icon-active: #ffffff;
    --tt-chip-background: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--tt-base-background);
    color: var(--tt-text-primary);
    font-family: 'Roboto', Arial, sans-serif;
    overflow-x: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.tt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    height: 56px;
    background: var(--tt-base-background);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tt-header-left {
    display: flex;
    align-items: center;
}

.tt-menu-icon {
    margin-right: 24px;
    cursor: pointer;
    color: var(--tt-text-primary);
}

.tt-logo {
    display: flex;
    align-items: center;
    color: white;
    text-decoration: none;
}

.tt-logo-icon {
    color: #ff0000;
    font-size: 28px;
    margin-right: 4px;
}

.tt-logo-text {
    font-size: 20px;
    font-weight: 700;
    color: white;
    letter-spacing: -1px;
}

.tt-main-content {
    display: flex;
    min-height: calc(100vh - 56px);
}

.tt-sidebar {
    width: 240px;
    max-width: 75vw;
    background: var(--tt-base-background);
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    padding-bottom: 12px;
    z-index: 90;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.tt-sidebar.mobile-visible {
    transform: translateX(0);
}

.tt-sidebar-section {
    padding-bottom: 0px!important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tt-sidebar-item {
    display: flex;
    align-items: center;
    padding: 10px 24px;
    color: var(--tt-text-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
}

.tt-sidebar-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tt-sidebar-item.active {
    background: rgba(255, 255, 255, 0.1);
    font-weight: 500;
}

.tt-sidebar-item i {
    margin-right: 24px;
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.tt-sidebar-heading {
    padding: 8px 24px;
    font-size: 16px;
    font-weight: 500;
    color: var(--tt-text-primary);
}

.tt-content-area {
    display: block;
    width: 99vw;
    padding: 16px;
    overflow: hidden!important;
}

.tt-sidebar-overlay {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 85;
}

.tt-sidebar-overlay.mobile-visible {
    display: block;
}

.tt-search-container {
    display: flex;
    flex: 1;
    max-width: 250px;
    margin-bottom: 25px;
}

.tt-search-input {
    flex: 1;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-right: none;
    border-radius: 2px 0 0 2px;
    color: var(--tt-text-primary);
    font-size: 16px;
}

.tt-search-input:focus {
    outline: none;
    border-color: var(--tt-themed-blue);
}

.tt-search-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0 2px 2px 0;
    width: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.tt-category-chips {
    display: flex;
    width: calc(100vw - 24px);
    overflow-x: auto;
    scrollbar-width: none;
}

.tt-category-chips::-webkit-scrollbar {
    display: none;
}

.tt-category-chip {
    background: var(--tt-chip-background);
    color: var(--tt-text-primary);
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    margin-right: 12px;
    white-space: nowrap;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.tt-category-chip:hover {
    background: rgba(255, 255, 255, 0.2);
}

.tt-category-chip.active {
    background: var(--tt-general-background);
    color: black;
}

.tt-video-grid {
    display: grid;
    grid-template-columns: repeat(4, calc(25vw - 4px)) !important;
    gap: 16px;
}

.tt-video-card {
    cursor: pointer;
}

.tt-thumbnail-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 12px;
    background: #000;
}

.tt-thumbnail-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.tt-video-card:hover .tt-thumbnail-img {
    opacity: 0.8;
}

.tt-duration-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    z-index: 5;
}

.tt-video-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    z-index: 4;
}

.tt-video-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--tt-error);
    text-align: center;
    z-index: 4;
    width: 80%;
}

.tt-video-info {
    display: flex;
    margin-top: 12px;
}

.tt-channel-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-right: 12px;
    margin: 10px 12px 0px 0px;
    object-fit: cover;
}

.tt-video-details {
    flex: 1;
}

.tt-video-title {
    color: var(--tt-text-primary);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tt-video-title a {
    color: white;
    text-decoration: none;
}

.tt-channel-name {
    color: var(--tt-text-secondary);
    font-size: 14px;
    margin-bottom: 4px;
}

.tt-video-metadata {
    color: var(--tt-text-secondary);
    font-size: 14px;
    display: flex;
    align-items: center;
}

.tt-metadata-separator {
    margin: 0 4px;
}

.tt-thumbnail-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    z-index: 3;
}

.tt-video-container {
    display: flex;
    gap: 24px;
}

.tt-video-player-section {
    flex: 7;
}

.tt-related-videos-section {
    flex: 3;
    overflow-y: auto;
    max-height: 200vh;
    scrollbar-width: none;
}

.tt-related-videos-section::-webkit-scrollbar {
    display: none;
}

.tt-video-player {
    width: 100%;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}

.tt-video-player video {
    width: 100%;
    height: 400px;
    display: block;
    object-fit: contain;
}

.tt-video-title {
    font-size: 18px;
    font-weight: 500;
    margin: 10px 0;
    color: var(--tt-text-primary);
}

.tt-video-metadata-single {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tt-video-views {
    color: var(--tt-text-secondary);
    font-size: 14px;
}

.tt-video-actions {
    display: flex;
    gap: 16px;
}

.tt-action-button {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--tt-text-secondary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.tt-action-button:hover {
    color: var(--tt-text-primary);
}

.tt-channel-info {
    display: flex;
    gap: 12px;
    padding: 16px 0 0 0;
    align-items: flex-start;
}

.tt-channel-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.tt-channel-details {
    flex: 1;
}

.tt-channel-name {
    font-weight: 500;
    margin-bottom: 4px;
}

.tt-subscriber-count {
    color: var(--tt-text-secondary);
    font-size: 14px;
}

.tt-subscribe-btn {
    background: #cc0000;
    color: white;
    border: none;
    padding: 5px 8px;
    border-radius: 5px;
    font-weight: 500;
    cursor: pointer;
    font-size: x-small;
}

.tt-video-description {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    padding: 12px;
    margin: 16px 0;
}

.tt-description-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--tt-text-primary);
}

.tt-show-more {
    color: var(--tt-text-secondary);
    font-weight: 500;
    margin-top: 8px;
    cursor: pointer;
}

.tt-related-header {
    font-size: 16px;
    margin-bottom: 16px;
    font-weight: 500;
}

.tt-related-video {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    cursor: pointer;
    color: var(--tt-text-primary);
    align-items: center;
}

.tt-related-thumbnail {
    width: 168px;
    height: 94px;
    border-radius: 4px;
    object-fit: cover;
}

.tt-related-info {
    flex: 1;
}

.tt-related-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tt-related-channel {
    font-size: 12px;
    color: var(--tt-text-secondary);
    margin-bottom: 4px;
}

.tt-related-meta {
    font-size: 12px;
    color: var(--tt-text-secondary);
}

.tt-tag-chip {
    display: inline-block;
    background: var(--tt-chip-background);
    color: var(--tt-text-primary);
    padding: 4px 12px;
    border-radius: 5px;
    margin: 4px;
    font-size: 13px;
    cursor: pointer;
}

.tt-tag-chip:hover {
    background: rgba(255, 255, 255, 0.2);
}

.tt-no-related {
    color: var(--tt-text-secondary);
    font-size: 14px;
}

/* Shorts Section Styles */
.tt-shorts-section {
    margin: 2rem 0;
}

.tt-shorts-heading {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.tt-shorts-heading i {
    color: #ff0000;
}

.tt-shorts-container {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 20px;
    padding-bottom: 1rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.tt-shorts-container::-webkit-scrollbar {
    display: none;
}

.tt-short-card {
    flex: 0 0 auto;
    width: 47%;
    scroll-snap-align: start;
    cursor: pointer;
    transition: transform 0.2s;
}

.tt-short-card:active {
    transform: scale(0.95);
}

.tt-short-thumbnail {
    position: relative;
    width: 100%;
    height: 320px;
    border-radius: 5px;
    overflow: hidden;
    background: #000;
}

.tt-short-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tt-short-duration {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 0.7rem;
}

.tt-short-info-style-1 {
    position: absolute;
    bottom: 0px;
    right: 0px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px;
    font-size: 0.7rem;
    width: 100%;
    color: #fff !important;
}

.tt-short-info-style-2 {
    padding: 8px 4px;
}

.tt-short-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.8);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tt-short-play-btn i {
    color: #000;
    font-size: 1rem;
    margin-left: 2px;
}

.tt-short-title {
    font-size: 0.85rem;
    margin: 0 0 4px 0;
    font-weight: 500;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tt-short-channel {
    font-size: 0.75rem;
    color: #606060;
    margin: 0 0 4px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tt-short-stats {
    font-size: 0.7rem;
    color: #606060;
}

.tt-shorts-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.tt-shorts-fullscreen-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 16px;
    display: flex;
    align-items: center;
    z-index: 10;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.595) 0%, transparent 100%);
    align-items: flex-start;
    flex-wrap: wrap;
    justify-content: space-between;
}

.tt-shorts-close-btn {
    background: rgba(0, 0, 0, 0.5);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-left: 16px;
    backdrop-filter: blur(10px);
}

.tt-shorts-video-info {
    color: white;
    max-width: 70vw;
}

.tt-shorts-fullscreen-title {
    font-size: 1rem;
    margin: 0;
    font-weight: 500;
}

.tt-shorts-fullscreen-channel {
    font-size: 0.85rem;
    margin: 4px 0 0 0;
    opacity: 0.8;
}

.tt-shorts-video-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tt-shorts-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.tt-shorts-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1.5rem;
}

.tt-shorts-controls {
    position: absolute;
    right: 20px;
    bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    z-index: 10;
}

.tt-shorts-btn {
    background: none;
    border: none;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 18px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.tt-shorts-btn:hover {
    transform: scale(1.2);
}

.tt-shorts-btn i {
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.tt-shorts-btn span {
    margin-top: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

.tt-shorts-category {
    position: relative;
}

.tt-shorts-container {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.tt-shorts-container::-webkit-scrollbar {
    display: none;
}

.tt-shorts-arrow {
    position: absolute;
    top: 47%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
}

.tt-shorts-arrow-left {
    left: -20px;
}

.tt-shorts-arrow-right {
    right: -20px;
}

.tt-shorts-arrow:hover {
    background: rgba(0, 0, 0, 0.7);
}

@media (max-width: 1200px) {
    .tt-video-grid {
        grid-template-columns: repeat(3, calc(33.33vw - 5.33px)) !important;
    }

    .tt-video-container {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .tt-video-grid {
        grid-template-columns: repeat(2, calc(50vw - 8px)) !important;
    }

    .tt-video-metadata-single {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .tt-video-actions {
        width: 100%;
        justify-content: space-between;
    }

    .tt-video-player video {
        height: 260px;
    }

    .tt-video-container {
        gap: 10px;
    }
}

@media (max-width: 600px) {
    .tt-video-grid {
        grid-template-columns: repeat(1, calc(100vw - 16px)) !important;
    }

    .tt-search-container {
        max-width: 100%;
    }

    .tt-related-thumbnail {
        width: 100px;
        height: 100px;
    }
}

@media (min-width: 768px) {
    .tt-short-card {
        width: 170px;
    }

    .tt-short-thumbnail {
        height: 300px;
    }

    .tt-shorts-container {
        gap: 24px;
    }

    .tt-short-player {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 300px;
        height: 500px;
        background: #000;
        z-index: 100;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }

    .tt-short-player video {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .tt-short-player-close {
        position: absolute;
        top: 10px;
        right: 10px;
        background: rgba(0, 0, 0, 0.5);
        color: white;
        border: none;
        width: 30px;
        height: 30px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}