/* ==========================================================================
   YouTube Video Manager Pro - Frontend Styles
   ========================================================================== */

:root {
    --ytvm-primary: #6366f1;
    --ytvm-primary-hover: #4f46e5;
    --ytvm-accent: #ef4444;
    --ytvm-bg: #ffffff;
    --ytvm-card-bg: #ffffff;
    --ytvm-text: #1e293b;
    --ytvm-text-muted: #64748b;
    --ytvm-border: #e2e8f0;
    --ytvm-shadow: 0 1px 3px rgba(0,0,0,0.08);
    --ytvm-shadow-hover: 0 10px 25px rgba(0,0,0,0.12);
    --ytvm-radius: 16px;
    --ytvm-radius-sm: 10px;
    --ytvm-font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.ytvm-video-grid {
    display: grid;
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.ytvm-columns-2 { grid-template-columns: repeat(2, 1fr); }
.ytvm-columns-3 { grid-template-columns: repeat(3, 1fr); }
.ytvm-columns-4 { grid-template-columns: repeat(4, 1fr); }

/* Video Card */
.ytvm-video-card {
    background: var(--ytvm-card-bg);
    border-radius: var(--ytvm-radius);
    overflow: hidden;
    box-shadow: var(--ytvm-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.ytvm-video-card:hover {
    box-shadow: var(--ytvm-shadow-hover);
    transform: translateY(-4px);
}

.ytvm-card-thumb {
    position: relative;
    padding-bottom: 56.25%;
    overflow: hidden;
    background: #000;
}

.ytvm-card-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.ytvm-video-card:hover .ytvm-card-thumb img {
    transform: scale(1.05);
}

.ytvm-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.85);
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--ytvm-font);
}

.ytvm-featured-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

.ytvm-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ytvm-video-card:hover .ytvm-card-overlay {
    opacity: 1;
}

.ytvm-play-btn {
    width: 60px;
    height: 60px;
    background: var(--ytvm-accent);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.ytvm-play-btn:hover {
    transform: scale(1.15);
    color: #fff;
    background: #dc2626;
}

.ytvm-play-btn i {
    margin-left: 3px;
}

/* Card Body */
.ytvm-card-body {
    padding: 16px 18px 18px;
}

.ytvm-card-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 10px;
    color: var(--ytvm-text);
}

.ytvm-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.ytvm-card-title a:hover {
    color: var(--ytvm-primary);
}

.ytvm-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: var(--ytvm-text-muted);
}

.ytvm-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ytvm-card-meta i {
    font-size: 12px;
    opacity: 0.7;
}

.ytvm-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--ytvm-border);
}

/* Buttons */
.ytvm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--ytvm-font);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1.4;
}

.ytvm-btn-primary {
    background: var(--ytvm-primary);
    color: #fff;
}

.ytvm-btn-primary:hover {
    background: var(--ytvm-primary-hover);
    color: #fff;
}

.ytvm-btn-ghost {
    background: transparent;
    color: var(--ytvm-text-muted);
    border: 1px solid var(--ytvm-border);
}

.ytvm-btn-ghost:hover {
    background: var(--ytvm-primary);
    color: #fff;
    border-color: var(--ytvm-primary);
}

.ytvm-btn-sm {
    padding: 5px 12px;
    font-size: 12px;
    border-radius: 6px;
}

.ytvm-fav-btn.active {
    color: var(--ytvm-accent);
    background: #fee2e2;
    border-color: #fecaca;
}

/* Share Popup */
.ytvm-share-popup {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.ytvm-share-popup.active {
    display: flex;
}

.ytvm-share-popup-inner {
    background: #fff;
    border-radius: var(--ytvm-radius);
    padding: 0;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    overflow: hidden;
}

.ytvm-share-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--ytvm-border);
}

.ytvm-share-popup-header h4 {
    margin: 0;
    font-size: 16px;
}

.ytvm-share-popup-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--ytvm-text-muted);
    padding: 0;
    line-height: 1;
}

.ytvm-share-popup-body {
    padding: 20px 24px;
}

.ytvm-share-links {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.ytvm-share-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    font-size: 18px;
    transition: transform 0.2s;
    text-decoration: none;
}

.ytvm-share-icon:hover {
    transform: scale(1.1);
    color: #fff;
}

.ytvm-share-facebook { background: #1877f2; }
.ytvm-share-twitter { background: #1da1f2; }
.ytvm-share-whatsapp { background: #25d366; }
.ytvm-share-linkedin { background: #0a66c2; }
.ytvm-share-telegram { background: #0088cc; }
.ytvm-share-pinterest { background: #e60023; }
.ytvm-share-email { background: #64748b; }

.ytvm-share-copy {
    display: flex;
    gap: 8px;
}

.ytvm-share-url-input {
    flex: 1;
    padding: 8px 12px;
    border: 1.5px solid var(--ytvm-border);
    border-radius: 6px;
    font-size: 13px;
    font-family: var(--ytvm-font);
    color: var(--ytvm-text);
    background: var(--ytvm-bg);
}

/* Popup Player */
.ytvm-popup {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0,0,0,0.9);
    display: none;
    align-items: center;
    justify-content: center;
}

.ytvm-popup.active {
    display: flex;
}

.ytvm-popup-inner {
    position: relative;
    width: 90%;
    max-width: 960px;
}

.ytvm-popup-content {
    position: relative;
    padding-bottom: 56.25%;
}

.ytvm-popup-content iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: var(--ytvm-radius-sm);
}

.ytvm-popup-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
}

/* Single Video Page */
.ytvm-single-video-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 20px;
}

.ytvm-single-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 32px;
}

.ytvm-video-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--ytvm-radius);
    background: #000;
}

.ytvm-video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.ytvm-single-title {
    font-size: 24px;
    font-weight: 700;
    margin: 20px 0 12px;
    line-height: 1.3;
}

.ytvm-single-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--ytvm-border);
    margin-bottom: 24px;
}

.ytvm-meta-left {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 14px;
    color: var(--ytvm-text-muted);
}

.ytvm-meta-left span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ytvm-meta-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ytvm-like-dislike {
    display: flex;
    gap: 4px;
}

.ytvm-like-btn.active {
    color: var(--ytvm-primary);
    border-color: var(--ytvm-primary);
}

.ytvm-dislike-btn.active {
    color: var(--ytvm-accent);
    border-color: var(--ytvm-accent);
}

.ytvm-single-description {
    margin-bottom: 32px;
}

.ytvm-single-description h3,
.ytvm-single-tags h3,
.ytvm-single-comments h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 16px;
}

.ytvm-desc-content {
    font-size: 14px;
    line-height: 1.7;
    color: var(--ytvm-text-muted);
    white-space: pre-wrap;
}

.ytvm-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ytvm-tag {
    display: inline-block;
    padding: 5px 14px;
    background: var(--ytvm-bg);
    border: 1px solid var(--ytvm-border);
    border-radius: 20px;
    font-size: 13px;
    color: var(--ytvm-text-muted);
    transition: all 0.2s;
}

.ytvm-tag:hover {
    border-color: var(--ytvm-primary);
    color: var(--ytvm-primary);
}

/* Comments */
.ytvm-single-comments {
    margin-top: 32px;
}

.ytvm-comment-form {
    margin-bottom: 24px;
}

.ytvm-comment-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--ytvm-border);
    border-radius: var(--ytvm-radius-sm);
    font-family: var(--ytvm-font);
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
    margin-bottom: 12px;
    box-sizing: border-box;
}

.ytvm-comment-form textarea:focus {
    outline: none;
    border-color: var(--ytvm-primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.ytvm-comment {
    padding: 16px 0;
    border-bottom: 1px solid var(--ytvm-border);
}

.ytvm-comment:last-child {
    border-bottom: none;
}

.ytvm-comment-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.ytvm-comment-author {
    font-size: 14px;
    font-weight: 600;
}

.ytvm-comment-date {
    font-size: 12px;
    color: var(--ytvm-text-muted);
}

.ytvm-comment-body {
    font-size: 14px;
    line-height: 1.6;
    color: var(--ytvm-text-muted);
}

.ytvm-login-notice {
    font-size: 14px;
    color: var(--ytvm-text-muted);
}

.ytvm-login-notice a {
    color: var(--ytvm-primary);
    text-decoration: none;
    font-weight: 600;
}

.ytvm-no-comments {
    font-size: 14px;
    color: var(--ytvm-text-muted);
    text-align: center;
    padding: 24px 0;
}

/* Related Videos Sidebar */
.ytvm-single-sidebar h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 20px;
}

.ytvm-related-card {
    margin-bottom: 16px;
}

.ytvm-related-card a {
    display: flex;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    padding: 10px;
    border-radius: var(--ytvm-radius-sm);
    transition: background 0.2s;
}

.ytvm-related-card a:hover {
    background: var(--ytvm-bg);
}

.ytvm-related-card img {
    width: 140px;
    height: 79px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.ytvm-related-info h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 6px;
    color: var(--ytvm-text);
    line-height: 1.3;
}

.ytvm-related-info span {
    display: block;
    font-size: 12px;
    color: var(--ytvm-text-muted);
}

/* Empty State */
.ytvm-empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--ytvm-text-muted);
}

.ytvm-empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.ytvm-empty-state p {
    font-size: 16px;
    margin: 0;
}

.ytvm-no-results {
    text-align: center;
    padding: 32px;
    color: var(--ytvm-text-muted);
    font-size: 15px;
}

.ytvm-error {
    padding: 16px;
    background: #fee2e2;
    color: #991b1b;
    border-radius: var(--ytvm-radius-sm);
    font-size: 14px;
}

/* Ad Zones */
.ytvm-ad-zone {
    margin: 24px 0;
    text-align: center;
}

.ytvm-ad-between {
    grid-column: 1 / -1;
}

/* Affiliate Zone */
.ytvm-affiliate-zone {
    max-width: 1400px;
    margin: 32px auto;
    padding: 24px 20px;
}

.ytvm-affiliate-zone h3 {
    font-size: 18px;
    margin-bottom: 16px;
}

.ytvm-affiliate-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.ytvm-affiliate-link {
    padding: 10px 18px;
    background: var(--ytvm-bg);
    border: 1px solid var(--ytvm-border);
    border-radius: var(--ytvm-radius-sm);
    color: var(--ytvm-primary);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
}

.ytvm-affiliate-link:hover {
    border-color: var(--ytvm-primary);
    background: rgba(99,102,241,0.05);
}

/* Loading */
.ytvm-loading-spinner {
    text-align: center;
    padding: 32px;
    color: var(--ytvm-text-muted);
    font-size: 14px;
}

.ytvm-loading-spinner::before {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--ytvm-border);
    border-top-color: var(--ytvm-primary);
    border-radius: 50%;
    animation: ytvm-spin 0.7s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes ytvm-spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 1024px) {
    .ytvm-single-container {
        grid-template-columns: 1fr;
    }
    .ytvm-single-sidebar {
        order: -1;
    }
    .ytvm-related-card a {
        flex-direction: row;
    }
    .ytvm-related-card img {
        width: 120px;
        height: 68px;
    }
}

@media (max-width: 768px) {
    .ytvm-columns-2,
    .ytvm-columns-3,
    .ytvm-columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    .ytvm-single-meta {
        flex-direction: column;
        align-items: flex-start;
    }
    .ytvm-single-title {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .ytvm-columns-2,
    .ytvm-columns-3,
    .ytvm-columns-4 {
        grid-template-columns: 1fr;
    }
    .ytvm-video-grid {
        padding: 12px;
        gap: 16px;
    }
}
