/**
 * YouTube Thumbnail Preview - Admin Styles
 */

/* ===== Variables ===== */
:root {
    --ytp-bg-light: #f9f9f9;
    --ytp-bg-dark: #0f0f0f;
    --ytp-card-light: #ffffff;
    --ytp-card-dark: #212121;
    --ytp-text-light: #0f0f0f;
    --ytp-text-dark: #f1f1f1;
    --ytp-text-muted-light: #606060;
    --ytp-text-muted-dark: #aaaaaa;
    --ytp-border-light: #e5e5e5;
    --ytp-border-dark: #3f3f3f;
    --ytp-accent: #ff0000;
    --ytp-dropzone-bg: #3ea6ff;
    --ytp-radius: 12px;
    --ytp-radius-sm: 8px;
}

/* ===== Base Styles ===== */
.ytp-wrap {
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 20px;
}

.ytp-container {
    background: var(--ytp-bg-light);
    min-height: 100vh;
}

.ytp-container.dark-mode {
    background: var(--ytp-bg-dark);
}

/* ===== Upload Section ===== */
.ytp-upload-section {
    background: var(--ytp-dropzone-bg);
    padding: 60px 40px;
    text-align: center;
    margin-bottom: 40px;
}

.ytp-dropzone {
    border: 3px dashed rgba(255, 255, 255, 0.5);
    border-radius: var(--ytp-radius);
    padding: 60px 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.ytp-dropzone:hover,
.ytp-dropzone.dragover {
    border-color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.1);
}

.ytp-dropzone-content {
    color: #ffffff;
}

.ytp-dropzone-content .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
}

.ytp-dropzone-content h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 500;
    color: #ffffff;
}

.ytp-dropzone-content p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
}

.ytp-dropzone-content .ytp-file-info {
    margin-top: 16px;
    font-size: 12px;
    opacity: 0.7;
}

.ytp-dropzone input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* ===== Controls ===== */
.ytp-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 24px;
}

.ytp-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: #ffffff;
}

.ytp-toggle input {
    display: none;
}

.ytp-toggle-slider {
    width: 44px;
    height: 24px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    position: relative;
    transition: all 0.3s ease;
}

.ytp-toggle-slider::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: #ffffff;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.3s ease;
}

.ytp-toggle input:checked + .ytp-toggle-slider {
    background: rgba(0, 0, 0, 0.5);
}

.ytp-toggle input:checked + .ytp-toggle-slider::after {
    left: 22px;
}

.ytp-toggle-label {
    font-size: 14px;
    font-weight: 500;
}

#ytp-clear-btn {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#ytp-clear-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ===== Title Input ===== */
.ytp-title-section {
    max-width: 800px;
    margin: 24px auto 0;
    padding: 0;
}

.ytp-title-label {
    display: block;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    text-align: left;
}

.ytp-title-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    outline: none;
    transition: all 0.3s ease;
}

.ytp-title-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.ytp-title-input:focus {
    border-color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.15);
}

.ytp-title-counter {
    text-align: right;
    margin-top: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.ytp-counter-good {
    color: rgba(255, 255, 255, 0.8);
}

.ytp-counter-caution {
    color: #ffd93d;
}

.ytp-counter-warning {
    color: #ff6b6b;
}

.ytp-counter-short {
    color: #a8d8ff;
}

/* Character limit badge */
.ytp-char-limit {
    font-size: 11px;
    font-weight: 400;
    color: var(--ytp-text-muted-light);
    opacity: 0.7;
}

.dark-mode .ytp-char-limit {
    color: var(--ytp-text-muted-dark);
}

/* ===== Preview Sections ===== */
.ytp-previews {
    padding: 0 40px 60px;
}

.ytp-section {
    margin-bottom: 48px;
}

.ytp-section-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 24px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ytp-border-light);
    color: var(--ytp-text-light);
}

.dark-mode .ytp-section-title {
    border-color: var(--ytp-border-dark);
    color: var(--ytp-text-dark);
}

.ytp-preview-block {
    margin-bottom: 32px;
}

.ytp-preview-title {
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 12px 0;
    color: var(--ytp-text-muted-light);
}

.dark-mode .ytp-preview-title {
    color: var(--ytp-text-muted-dark);
}

/* ===== Thumbnail Wrapper ===== */
.ytp-thumb-wrapper {
    position: relative;
    border-radius: var(--ytp-radius-sm);
    overflow: hidden;
    background: #000;
}

.ytp-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ytp-duration {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.8);
    color: #ffffff;
    font-size: 12px;
    font-weight: 500;
    padding: 2px 4px;
    border-radius: 4px;
}

/* ===== Video Info ===== */
.ytp-video-info {
    display: flex;
    gap: 12px;
    padding: 12px 0;
}

.ytp-channel-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    flex-shrink: 0;
}

.ytp-channel-avatar-small {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    flex-shrink: 0;
}

.ytp-video-meta {
    flex: 1;
    min-width: 0;
}

.ytp-video-title {
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 4px 0;
    line-height: 1.4;
    color: var(--ytp-text-light);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dark-mode .ytp-video-title {
    color: var(--ytp-text-dark);
}

.ytp-channel-name {
    font-size: 12px;
    color: var(--ytp-text-muted-light);
    margin: 0;
}

.dark-mode .ytp-channel-name {
    color: var(--ytp-text-muted-dark);
}

.ytp-video-stats {
    font-size: 12px;
    color: var(--ytp-text-muted-light);
    margin: 0;
}

.dark-mode .ytp-video-stats {
    color: var(--ytp-text-muted-dark);
}

/* ===== Home Large ===== */
.ytp-home-large {
    max-width: 360px;
}

.ytp-home-large .ytp-thumb-wrapper {
    aspect-ratio: 16 / 9;
}

/* ===== Home Small ===== */
.ytp-home-small {
    max-width: 240px;
}

.ytp-home-small .ytp-thumb-wrapper {
    aspect-ratio: 16 / 9;
}

.ytp-home-small .ytp-video-title {
    font-size: 13px;
}

/* ===== Watch Sidebar ===== */
.ytp-watch-sidebar {
    display: flex;
    gap: 8px;
    max-width: 400px;
}

.ytp-watch-sidebar .ytp-thumb-wrapper {
    width: 168px;
    flex-shrink: 0;
    aspect-ratio: 16 / 9;
}

.ytp-watch-sidebar .ytp-video-info {
    padding: 0;
}

.ytp-watch-sidebar .ytp-video-title {
    font-size: 13px;
    -webkit-line-clamp: 2;
}

.ytp-watch-sidebar .ytp-duration {
    font-size: 11px;
}

/* ===== Channel Large ===== */
.ytp-channel-large {
    max-width: 400px;
}

.ytp-channel-large .ytp-thumb-wrapper {
    aspect-ratio: 16 / 9;
}

/* ===== Channel Grid ===== */
.ytp-channel-grid {
    max-width: 200px;
}

.ytp-channel-grid .ytp-thumb-wrapper {
    aspect-ratio: 16 / 9;
}

.ytp-channel-grid .ytp-video-title {
    font-size: 13px;
    -webkit-line-clamp: 2;
}

/* ===== Playlist ===== */
.ytp-playlist {
    max-width: 210px;
}

.ytp-playlist .ytp-thumb-wrapper {
    aspect-ratio: 16 / 9;
}

.ytp-playlist-overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 50%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff;
}

.ytp-playlist-count {
    font-size: 18px;
    font-weight: 500;
}

.ytp-playlist-overlay .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

/* ===== Search Results ===== */
.ytp-search-result {
    display: flex;
    gap: 16px;
    max-width: 800px;
}

.ytp-search-result .ytp-thumb-wrapper {
    width: 360px;
    flex-shrink: 0;
    aspect-ratio: 16 / 9;
}

.ytp-search-result .ytp-video-info {
    padding: 0;
    flex-direction: column;
}

.ytp-search-result .ytp-video-title {
    font-size: 18px;
    -webkit-line-clamp: 2;
    margin-bottom: 8px;
}

.ytp-video-stats-inline {
    font-size: 12px;
    color: var(--ytp-text-muted-light);
    margin: 0 0 12px 0;
}

.dark-mode .ytp-video-stats-inline {
    color: var(--ytp-text-muted-dark);
}

.ytp-channel-info-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.ytp-video-description {
    font-size: 12px;
    color: var(--ytp-text-muted-light);
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dark-mode .ytp-video-description {
    color: var(--ytp-text-muted-dark);
}

/* ===== End Screen ===== */
.ytp-end-screen {
    max-width: 640px;
}

.ytp-end-screen-bg {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: var(--ytp-radius-sm);
    overflow: hidden;
}

.ytp-end-screen-thumb {
    filter: blur(8px) brightness(0.5);
    transform: scale(1.1);
}

.ytp-end-screen-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 40px;
}

.ytp-end-screen-element {
    width: 180px;
    aspect-ratio: 16 / 9;
    border-radius: var(--ytp-radius-sm);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* ===== Mobile Section ===== */
.ytp-mobile-frame {
    background: var(--ytp-card-light);
    border-radius: 24px;
    padding: 12px;
    max-width: 375px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.dark-mode .ytp-mobile-frame {
    background: var(--ytp-card-dark);
}

/* Mobile Home */
.ytp-mobile-home .ytp-thumb-wrapper {
    aspect-ratio: 16 / 9;
    border-radius: 0;
}

.ytp-mobile-home .ytp-video-info {
    align-items: flex-start;
}

.ytp-mobile-menu {
    background: none;
    border: none;
    color: var(--ytp-text-muted-light);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
}

.dark-mode .ytp-mobile-menu {
    color: var(--ytp-text-muted-dark);
}

/* Mobile Search */
.ytp-mobile-search {
    display: flex;
    gap: 12px;
}

.ytp-mobile-search .ytp-thumb-wrapper {
    width: 160px;
    flex-shrink: 0;
    aspect-ratio: 16 / 9;
}

.ytp-mobile-search .ytp-video-info {
    padding: 0;
    flex: 1;
}

.ytp-mobile-search .ytp-video-title {
    font-size: 13px;
    -webkit-line-clamp: 2;
}

.ytp-mobile-search .ytp-video-stats {
    font-size: 11px;
}

/* ===== TV Section ===== */
.ytp-section-tv {
    background: #000;
    margin-left: -40px;
    margin-right: -40px;
    padding: 40px;
}

.ytp-section-tv .ytp-section-title {
    color: #ffffff;
    border-color: #333;
}

.ytp-section-tv .ytp-preview-title {
    color: #888;
}

.ytp-tv-frame {
    background: #0f0f0f;
    border-radius: 8px;
    padding: 20px;
    max-width: 600px;
}

.ytp-tv-featured {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    overflow: hidden;
}

.ytp-tv-featured .ytp-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ytp-tv-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 60px 24px 24px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
}

.ytp-tv-info .ytp-video-title {
    font-size: 24px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
}

.ytp-tv-meta {
    font-size: 14px;
    color: #aaaaaa;
    margin: 4px 0;
}

/* ===== Original Image ===== */
.ytp-original {
    max-width: 1280px;
}

.ytp-original .ytp-thumb-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.ytp-original .ytp-thumb {
    width: 100%;
    height: auto;
    border-radius: var(--ytp-radius-sm);
    display: block;
}

.ytp-original-info {
    font-size: 14px;
    color: var(--ytp-text-muted-light);
    margin-bottom: 12px;
}

.dark-mode .ytp-original-info {
    color: var(--ytp-text-muted-dark);
}

/* Rule of Thirds Grid Overlay */
.ytp-grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: var(--ytp-radius-sm);
    overflow: hidden;
}

.ytp-grid-overlay.active {
    opacity: 1;
}

.ytp-grid-overlay img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Collapsible Section */
.ytp-section-collapsible .ytp-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ytp-border-light);
    margin-bottom: 24px;
    user-select: none;
}

.dark-mode .ytp-section-collapsible .ytp-section-header {
    border-color: var(--ytp-border-dark);
}

.ytp-section-collapsible .ytp-section-title {
    margin: 0;
    padding: 0;
    border: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ytp-collapse-icon {
    font-size: 20px;
    transition: transform 0.3s ease;
    color: var(--ytp-text-muted-light);
}

.dark-mode .ytp-collapse-icon {
    color: var(--ytp-text-muted-dark);
}

.ytp-section-collapsible.collapsed .ytp-collapse-icon {
    transform: rotate(-90deg);
}

.ytp-section-content {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 2000px;
    opacity: 1;
}

.ytp-section-collapsible.collapsed .ytp-section-content {
    max-height: 0;
    opacity: 0;
}

/* Original Section Controls */
.ytp-original-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
}

.ytp-grid-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--ytp-text-light);
    font-size: 14px;
}

.dark-mode .ytp-grid-toggle {
    color: var(--ytp-text-dark);
}

.ytp-grid-toggle input {
    display: none;
}

.ytp-grid-toggle-slider {
    width: 36px;
    height: 20px;
    background: var(--ytp-border-light);
    border-radius: 10px;
    position: relative;
    transition: all 0.3s ease;
}

.dark-mode .ytp-grid-toggle-slider {
    background: var(--ytp-border-dark);
}

.ytp-grid-toggle-slider::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: #ffffff;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.ytp-grid-toggle input:checked + .ytp-grid-toggle-slider {
    background: #3ea6ff;
}

.ytp-grid-toggle input:checked + .ytp-grid-toggle-slider::after {
    left: 18px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .ytp-upload-section {
        padding: 40px 20px;
    }
    
    .ytp-dropzone {
        padding: 40px 20px;
    }
    
    .ytp-previews {
        padding: 0 20px 40px;
    }
    
    .ytp-search-result {
        flex-direction: column;
    }
    
    .ytp-search-result .ytp-thumb-wrapper {
        width: 100%;
    }
    
    .ytp-section-tv {
        margin-left: -20px;
        margin-right: -20px;
        padding: 20px;
    }
}
