/**
 * HDMovie2 Additional Styles
 * Supplementary CSS for enhanced components
 *
 * @package HDMovie2
 */

/* ===================== KEYBOARD NAV ===================== */
.keyboard-nav *:focus {
    outline: 2px solid var(--accent-red) !important;
    outline-offset: 2px;
}

/* ===================== MOVIE CARD PLACEHOLDER ===================== */
.movie-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    position: relative;
}

/* ===================== STICKY SIDEBAR ===================== */
@media (min-width: 993px) {
    .sidebar-area {
        position: sticky;
        top: calc(var(--header-height) + 20px);
        align-self: flex-start;
        max-height: calc(100vh - var(--header-height) - 40px);
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: var(--border-color) transparent;
    }

    .sidebar-area::-webkit-scrollbar {
        width: 4px;
    }

    .sidebar-area::-webkit-scrollbar-track {
        background: transparent;
    }

    .sidebar-area::-webkit-scrollbar-thumb {
        background: var(--border-color);
        border-radius: 2px;
    }
}

/* ===================== MOVIE CARD LINK ===================== */
.movie-card-link {
    display: block;
    color: inherit;
}

.movie-card-link:hover {
    color: inherit;
}

/* ===================== MOBILE SUB-MENU ===================== */
.mobile-drawer .sub-menu {
    display: none;
    padding-left: 15px;
    background: rgba(0, 0, 0, 0.15);
}

.mobile-drawer .submenu-open > .sub-menu {
    display: block;
}

.mobile-drawer .menu-item-has-children > a {
    position: relative;
}

.mobile-drawer .menu-item-has-children > a::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--text-muted);
    margin-left: 8px;
    vertical-align: middle;
    transition: transform 0.2s ease;
}

.mobile-drawer .submenu-open > a::after {
    transform: rotate(180deg);
}

/* ===================== LOADING SKELETON ===================== */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-input) 25%, var(--border-color) 50%, var(--bg-input) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

/* ===================== TOOLTIP ===================== */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    background: var(--bg-header);
    color: var(--text-primary);
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 100;
    border: 1px solid var(--border-color);
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-8px);
}

/* ===================== PAGE LINKS ===================== */
.page-links {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 20px 0;
    font-weight: 500;
}

.page-links a,
.page-links span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.page-links a:hover,
.page-links > span {
    background: var(--accent-red);
    border-color: var(--accent-red);
    color: #fff;
}

/* ===================== COMMENT FORM FIELDS ===================== */
.comment-form-cookies-consent {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    font-size: 13px;
    color: var(--text-secondary);
}

.comment-form-cookies-consent input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-red);
}

/* ===================== NAVIGATION COMMENTS ===================== */
.comment-navigation {
    display: flex;
    justify-content: space-between;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 15px;
}

.comment-navigation a {
    color: var(--accent-red);
    font-size: 14px;
}

/* ===================== WORDPRESS BLOCKS ===================== */
.wp-block-image {
    margin: 20px 0;
}

.wp-block-image img {
    border-radius: var(--radius-md);
}

.wp-block-gallery {
    margin: 20px 0;
}

.wp-block-quote {
    border-left: 4px solid var(--accent-red);
    padding: 15px 20px;
    margin: 20px 0;
    background: rgba(229, 9, 20, 0.05);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.wp-block-quote cite {
    display: block;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 13px;
}

.wp-block-separator {
    border-color: var(--border-color);
    margin: 25px 0;
}

.wp-block-button .wp-block-button__link {
    background: var(--accent-red);
    color: #fff;
    border-radius: var(--radius-md);
    padding: 12px 24px;
    transition: var(--transition);
}

.wp-block-button .wp-block-button__link:hover {
    background: var(--accent-red-hover);
}

.wp-block-table table {
    width: 100%;
    border-collapse: collapse;
}

.wp-block-table td,
.wp-block-table th {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
}

.wp-block-table th {
    background: rgba(0, 0, 0, 0.2);
}

/* ===================== ALIGNMENTS ===================== */
.alignleft {
    float: left;
    margin: 0 20px 10px 0;
}

.alignright {
    float: right;
    margin: 0 0 10px 20px;
}

.aligncenter {
    display: block;
    margin: 15px auto;
}

.alignwide {
    margin-left: -20px;
    margin-right: -20px;
    max-width: calc(100% + 40px);
}

.alignfull {
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    max-width: 100vw;
    width: 100vw;
}

/* ===================== SELECTION ===================== */
::selection {
    background: var(--accent-red);
    color: #fff;
}

::-moz-selection {
    background: var(--accent-red);
    color: #fff;
}

/* ===================== SMOOTH SCROLLBAR ===================== */
html {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-red) var(--bg-primary);
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-red);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-red-hover);
}

/* ===================== FOOTER WIDGET GRID ===================== */
.footer-widgets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.footer-widget {
    background: transparent;
    border: none;
}

.footer-widget .widget-title {
    background: transparent;
    border-bottom: 2px solid var(--accent-red);
    padding: 0 0 10px;
    margin-bottom: 15px;
}

/* ===================== SCREEN READER TEXT (WP DEFAULT) ===================== */
.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;
}

.screen-reader-text:focus {
    background-color: var(--bg-card);
    border-radius: var(--radius-sm);
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    clip-path: none;
    color: var(--text-heading);
    display: block;
    font-size: 14px;
    font-weight: 700;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* ===================== POST NAV LINKS ===================== */
.post-navigation {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin: 25px 0;
}

.post-navigation a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
    max-width: 48%;
}

.post-navigation a:hover {
    background: rgba(229, 9, 20, 0.1);
    border-color: var(--accent-red);
    color: var(--accent-red);
}

/* ===================== WP CAPTION ===================== */
.wp-caption {
    max-width: 100%;
    margin: 15px 0;
}

.wp-caption img {
    border-radius: var(--radius-md);
}

.wp-caption-text {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    padding: 8px 0;
    font-style: italic;
}

/* ===================== ADMIN BAR OFFSET ===================== */
.admin-bar .site-header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    .admin-bar .site-header {
        top: 46px;
    }
}
