/*
Theme Name: TemaVideo
Version: 1.0 
*/


/* ============================================================
   ROOT VARIABLES
   ============================================================ */
:root {
    --sky-500: #0ea5e9;
    --sky-600: #0284c7;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --text-light: #d1d5db;
    --text-lighter: #e5e7eb;
    --text-muted: #9ca3af;
}

/* ============================================================
   BASE STYLES
   ============================================================ */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--gray-900);
    color: var(--text-light);
    margin: 0;
    line-height: 1.6;
    font-size: 15px;
}
@media (min-width: 768px) {
    body {
        font-size: 16px;
    }
}

/* ============================================================
   LAYOUT & CONTAINERS
   ============================================================ */
.main-container {
    width: 100%;
    max-width: 1440px;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
    margin-left: auto;
    margin-right: auto;
}
@media (min-width: 768px) {
    .main-container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.hidden {
    display: none !important;
}
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}

/* ============================================================
   HEADER STYLES
   ============================================================ */
header.site-header {
    background-color: var(--gray-800);
    border-bottom: 1px solid var(--gray-700);
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 0.75rem 0;
}
header.site-header .main-container-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
header.site-header a,
header.site-header button:not(.search-submit) {
    color: var(--text-lighter);
    background: none;
    border: none;
    cursor: pointer;
}
header.site-header a:hover,
header.site-header button:not(.search-submit):hover {
    color: var(--sky-500);
}

/* ============================================================
   SITE BRANDING
   ============================================================ */
.site-branding {
    flex-shrink: 0;
}
.site-branding .site-title a {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-lighter);
    text-decoration: none;
    line-height: 1;
}
.site-branding .site-title a span {
    color: var(--sky-500);
}
@media (min-width: 640px) {
    .site-branding .site-title a {
        font-size: 1.25rem;
    }
}
@media (min-width: 768px) {
    .site-branding .site-title a {
        font-size: 1.5rem;
    }
}

/* ============================================================
   NAVIGATION
   ============================================================ */
nav.main-navigation {
    flex-grow: 1;
}
nav.main-navigation ul.primary-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
}
@media (min-width: 1024px) {
    nav.main-navigation ul.primary-menu {
        gap: 1rem;
    }
}
nav.main-navigation ul.primary-menu li a {
    color: var(--text-lighter);
    text-decoration: none;
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    transition: color 0.2s;
}
nav.main-navigation ul.primary-menu li a:hover,
nav.main-navigation ul.primary-menu li.current-menu-item > a {
    color: var(--sky-500);
}

/* ============================================================
   DESKTOP SEARCH FORM
   ============================================================ */
.desktop-search-form {
    display: none;
    flex-grow: 0;
    max-width: 280px;
}
@media (min-width: 1024px) {
    .desktop-search-form {
        display: block;
        margin-left: auto;
    }
    nav.main-navigation {
        margin-right: auto;
    }
}
.desktop-search-form form.search-form {
    display: flex;
    gap: 0.5rem;
}
.desktop-search-form input.search-field {
    flex-grow: 1;
    background-color: var(--gray-700);
    border: 1px solid var(--gray-700);
    color: var(--text-lighter);
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.desktop-search-form input.search-field:focus {
    outline: none;
    border-color: var(--sky-500);
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.3);
}
.desktop-search-form input.search-field::placeholder {
    color: var(--text-muted);
}
.desktop-search-form button.search-submit {
    background-color: var(--sky-500);
    color: white;
    font-weight: 500;
    padding: 0.5rem 0.8rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}
.desktop-search-form button.search-submit:hover {
    background-color: var(--sky-600);
}
.desktop-search-form button.search-submit i {
    font-size: 0.9rem;
}

/* ============================================================
   HEADER ACTIONS
   ============================================================ */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}
.header-actions button {
    padding: 0.5rem;
}
.header-actions button i {
    font-size: 1rem;
}

/* ============================================================
   MOBILE MENU DRAWER
   ============================================================ */
#mobileMenuDrawer {
    background-color: var(--gray-700);
    border-top: 1px solid var(--gray-800);
}
#mobileMenuDrawer ul.mobile-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}
#mobileMenuDrawer ul.mobile-menu li a {
    color: var(--text-lighter);
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    display: block;
    transition: background-color 0.2s;
    text-decoration: none;
    border-bottom: 1px solid var(--gray-800);
}
#mobileMenuDrawer ul.mobile-menu li:last-child a {
    border-bottom: none;
}
#mobileMenuDrawer ul.mobile-menu li a:hover {
    background-color: #4b5563;
    color: white;
}

/* ============================================================
   MOBILE SEARCH DRAWER
   ============================================================ */
.search-drawer-mobile {
    background-color: var(--gray-700);
    padding: 1rem;
    border-top: 1px solid var(--gray-800);
}
.search-drawer-mobile form.search-form {
    display: flex;
    gap: 0.5rem;
}
.search-drawer-mobile input.search-field {
    flex-grow: 1;
    background-color: var(--gray-800);
    border: 1px solid #4b5563;
    color: var(--text-lighter);
    padding: 0.6rem;
    border-radius: 0.375rem;
    font-size: 0.9rem;
}
.search-drawer-mobile input.search-field::placeholder {
    color: var(--text-muted);
}
.search-drawer-mobile button.search-submit {
    background-color: var(--sky-500);
    color: white;
    font-weight: 500;
    padding: 0.6rem 1rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}
.search-drawer-mobile button.search-submit:hover {
    background-color: var(--sky-600);
}
.search-drawer-mobile h3.search-drawer-title {
    font-size: 1rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.75rem;
}

/* ============================================================
   AD SLOTS
   ============================================================ */
.ad-slot {
    background-color: var(--gray-700);
    border: 1px dashed var(--gray-600);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 50px;
    font-size: 0.8rem;
    border-radius: 0.25rem;
}
.ad-slot-header-banner {
    width: 100%;
    height: 70px;
    margin-bottom: 0.5rem;
}
.ad-slot-video-banner {
    height: 60px;
    margin-bottom: 0.75rem;
}
.ad-slot-in-content-banner {
    width: 100%;
    max-width: 728px;
    height: 90px;
    margin: 1.5rem auto;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
main.site-main,
main.site-main-single {
    padding-top: 1rem;
    padding-bottom: 1.5rem;
}
@media (min-width: 768px) {
    main.site-main,
    main.site-main-single {
        padding-top: 1.5rem;
    }
}
section#home {
    margin-bottom: 2rem;
}
@media (min-width: 768px) {
    section#home {
        margin-bottom: 3rem;
    }
}

/* ============================================================
   SECTION TITLE
   ============================================================ */
.section-title {
    color: var(--text-lighter);
    border-left: 3px solid var(--sky-500);
    padding-left: 0.6rem;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    font-weight: 600;
    line-height: 1.3;
}
@media (min-width: 768px) {
    .section-title {
        font-size: 1.375rem;
    }
}
@media (min-width: 1024px) {
    .section-title {
        font-size: 1.5rem;
    }
}

/* ============================================================
   VIDEO GRID & CARDS
   ============================================================ */
.video-grid-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.2rem;
}
@media (min-width: 768px) {
    .video-grid-container {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.5rem;
    }
}
.video-card {
    background-color: var(--gray-800);
    border: 1px solid var(--gray-700);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 0.375rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}
.video-card a.block {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
}
.thumbnail-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    background-color: var(--gray-700);
    overflow: hidden;
}
.thumbnail-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease-in-out;
}
.video-card:hover .thumbnail-container img {
    transform: scale(1.05);
}
.video-card .card-content {
    padding: 0.5rem 0.6rem 0.6rem;
    flex-grow: 1;
}
.video-card h3.entry-title {
    color: var(--text-lighter);
    font-weight: 500;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: calc(1.35em * 2);
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}
@media (min-width: 768px) {
    .card-content h3.entry-title {
        font-size: 0.875rem;
    }
}
.video-duration {
    position: absolute;
    bottom: 0.35rem;
    right: 0.35rem;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.65rem;
}
.video-stats {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}
.video-stats i {
    margin-right: 0.1rem;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 1.5rem;
    gap: 0.35rem;
}
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0.25rem 0.4rem;
    border: 1px solid #4b5563;
    border-radius: 4px;
    color: var(--text-light);
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
    font-size: 0.8rem;
}
.pagination a.page-numbers:hover {
    background-color: var(--sky-500);
    color: white;
    border-color: var(--sky-500);
}
.pagination .page-numbers.current {
    background-color: var(--sky-500);
    color: white;
    border-color: var(--sky-500);
    font-weight: 600;
}
.pagination .page-numbers.dots {
    border: none;
    pointer-events: none;
    color: var(--text-muted);
    min-width: auto;
    padding: 0 0.25rem;
}

/* ============================================================
   NO POSTS & ERROR STYLES
   ============================================================ */
.no-posts-found {
    padding: 1rem;
    background-color: var(--gray-800);
    border-radius: 0.375rem;
    text-align: center;
    color: var(--text-muted);
}
.error-no-post {
    color: var(--text-muted);
}




/* ============================================================
   VIDEO UPLOADER
   ============================================================ */
.video-uploader-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 30px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}
.video-uploader-container h1 {
    text-align: center;
    color: #333;
    margin-bottom: 25px;
    font-size: 2.5em;
    font-weight: 700;
}
.video-uploader-container p.description {
    text-align: center;
    color: #555;
    margin-bottom: 35px;
    font-size: 1.15em;
    line-height: 1.6;
}

/* ============================================================
   CONTENT WARNING
   ============================================================ */
.content-warning {
    color: #856404;
    border: 1px solid #ffeeba;
    background-color: #fff3cd;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 8px;
    line-height: 1.7;
    font-size: 0.95em;
}
.content-warning strong {
    display: block;
    margin-bottom: 8px;
    color: #664d03;
    font-weight: 700;
}

/* ============================================================
   UPLOADER FORM
   ============================================================ */
.video-uploader-form,
#metadataForm {
    margin-top: 25px;
    padding: 30px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    background-color: #f9f9f9;
}
.video-uploader-form .form-group,
#metadataForm .form-group {
    margin-bottom: 25px;
}
.video-uploader-form label,
#metadataForm label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #444;
    font-size: 1em;
}
.video-uploader-form input::file-selector-button {
    padding: 12px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
    font-weight: 500;
}
.video-uploader-form input::file-selector-button:hover {
    background-color: #0056b3;
}
.video-uploader-form input#videoInput {
    display: block;
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    background-color: #fff;
    font-size: 1em;
}
#metadataForm input#videoTitle,
#metadataForm textarea#videoDescription {
    display: block;
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 1em;
}
#metadataForm textarea#videoDescription {
    min-height: 120px;
    resize: vertical;
}
.video-uploader-form .file-info {
    font-size: 0.85em;
    color: #777;
    margin-top: 8px;
    display: block;
}
.video-uploader-form .server-choice p {
    margin-bottom: 10px;
    font-weight: 600;
    color: #444;
    font-size: 1em;
}
.video-uploader-form .server-choice label {
    font-weight: normal;
    margin-right: 25px;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.95em;
}
.video-uploader-form .server-choice input#selected_thumbnail_server_doodstream,
.video-uploader-form .server-choice input#selected_thumbnail_server_lulustream {
    margin-right: 10px;
    cursor: pointer;
    transform: scale(0.9);
}
.video-uploader-form button#uploadButton,
#metadataForm button#saveMetadataButton {
    display: block;
    width: 100%;
    padding: 15px 25px;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    transition: background-color 0.2s ease-in-out, transform 0.1s ease;
}
.video-uploader-form button#uploadButton {
    background-color: #007bff;
}
.video-uploader-form button#uploadButton:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}
#metadataForm button#saveMetadataButton {
    background-color: #28a745;
    margin-top: 15px;
}
#metadataForm button#saveMetadataButton:hover {
    background-color: #218838;
    transform: translateY(-2px);
}
.video-uploader-form button#uploadButton:disabled,
#metadataForm button#saveMetadataButton:disabled {
    background-color: #a0a0a0;
    cursor: not-allowed;
    transform: translateY(0);
}

/* ============================================================
   PROGRESS & STATUS
   ============================================================ */
#progressContainer {
    margin-top: 30px;
    background-color: #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    display: none;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}
#progressBar {
    width: 0%;
    height: 35px;
    background-color: #007bff;
    text-align: center;
    line-height: 35px;
    color: white;
    font-weight: bold;
    transition: width 0.3s ease-in-out;
    font-size: 0.95em;
}
#statusMessage,
#metaStatusMessage {
    margin-top: 15px;
    text-align: center;
    font-weight: 500;
    font-size: 1em;
    min-height: 25px;
}
#statusMessage.processing,
#metaStatusMessage.processing {
    color: #007bff;
}
#statusMessage.success,
#metaStatusMessage.success {
    color: #155724;
}
#statusMessage.error,
#metaStatusMessage.error {
    color: #721c24;
}

/* ============================================================
   RESULT & THUMBNAIL
   ============================================================ */
#result {
    margin-top: 30px;
    padding: 25px;
    border: 1px solid transparent;
    border-radius: 10px;
    line-height: 1.7;
    background-color: #f8f9fa;
    box-shadow: 0 2px 5px rgba(0,0,0,0.06);
}
#result h4 {
    margin-top: 0;
    color: #007bff;
    border-bottom: 1px solid #eee;
    padding-bottom: 12px;
    margin-bottom: 20px;
    font-size: 1.3em;
}
#result .message-box {
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 1em;
}
#result .success-overall {
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
}
#result .error-overall {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
}
#result .service-status {
    margin-bottom: 12px;
    padding: 12px;
    border-left: 5px solid #007bff;
    background-color: #e7f3ff;
    font-size: 0.95em;
}
#result .service-status.success {
    border-left-color: #28a745;
    background-color: #e6ffe9;
}
#result .service-status.failure {
    border-left-color: #dc3545;
    background-color: #ffe7e7;
}
#result .service-status strong {
    color: #333;
}
#thumbnailContainer {
    margin-top: 30px;
    text-align: center;
    display: none;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}
#thumbnailContainer h3 {
    margin-bottom: 18px;
    color: #444;
    font-size: 1.2em;
}
#thumbnailPreview {
    max-width: 100%;
    width: auto;
    max-height: 360px;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    background-color: #fff;
    padding: 8px;
}