/**
 * TionStation PC Enhanced CSS
 * Sticky header, enhanced navigation, sidebar, keyboard shortcuts, reading progress
 * @version 2.0.0
 */

/* =====================================================
   PC-ONLY STYLES (min-width: 769px)
   ===================================================== */
@media (min-width: 769px) {

    /* ===== READING PROGRESS BAR ===== */
    .tion-reading-progress {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        z-index: 99999;
        background: transparent;
    }

    .tion-reading-progress-bar {
        height: 100%;
        width: 0%;
        background: linear-gradient(90deg, #00D9FF, #0066FF, #00D9FF);
        background-size: 200% 100%;
        animation: progressGradient 3s linear infinite;
        transition: width 0.1s linear;
        border-radius: 0 2px 2px 0;
    }

    @keyframes progressGradient {
        0% { background-position: 0% 50%; }
        100% { background-position: 200% 50%; }
    }

    /* ===== SCROLL TO TOP BUTTON ===== */
    .tion-scroll-top {
        position: fixed;
        bottom: 32px;
        right: 32px;
        width: 48px;
        height: 48px;
        background: rgba(10, 14, 39, 0.9);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid rgba(0, 217, 255, 0.2);
        border-radius: 50%;
        color: #00D9FF;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        visibility: hidden;
        transform: translateY(20px);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 9998;
        padding: 0;
    }

    .tion-scroll-top.visible {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .tion-scroll-top:hover {
        background: rgba(0, 102, 255, 0.9);
        color: white;
        border-color: rgba(0, 102, 255, 0.6);
        transform: translateY(-3px);
        box-shadow: 0 8px 25px rgba(0, 102, 255, 0.4);
    }

    .tion-scroll-top .material-icons-round {
        font-size: 24px;
        position: relative;
        z-index: 1;
    }

    .tion-scroll-top-progress {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        transform: rotate(-90deg);
    }

    .tion-scroll-top-progress circle {
        stroke: rgba(0, 217, 255, 0.4);
        transition: stroke-dashoffset 0.1s linear;
    }

    /* ===== FLOATING CONTROLS ===== */
    .tion-pc-floating-controls {
        position: fixed;
        bottom: 90px;
        right: 32px;
        z-index: 9998;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .tion-floating-btn {
        width: 44px;
        height: 44px;
        background: rgba(10, 14, 39, 0.9);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 50%;
        color: #A0AEC0;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
        padding: 0;
    }

    .tion-floating-btn:hover {
        background: rgba(0, 102, 255, 0.15);
        border-color: rgba(0, 102, 255, 0.4);
        color: #00D9FF;
        transform: scale(1.1);
    }

    .tion-floating-btn .material-icons-round {
        font-size: 20px;
    }

    /* Dark mode icon visibility */
    .tion-dark-icon { display: block; }
    .tion-light-icon { display: none; }
    .tion-dark-mode .tion-dark-icon { display: none; }
    .tion-dark-mode .tion-light-icon { display: block; }

    /* ===== ENHANCED NAVIGATION (PC) ===== */
    .wp-block-navigation {
        transition: all 0.3s ease;
    }

    /* Sticky header effect */
    .tion-header-scrolled {
        background: rgba(10, 14, 39, 0.95) !important;
        backdrop-filter: blur(20px) !important;
        box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    }

    /* ===== TABLE OF CONTENTS (Sidebar) ===== */
    .tion-toc-sidebar {
        position: fixed;
        top: 100px;
        right: 20px;
        width: 260px;
        max-height: calc(100vh - 150px);
        background: rgba(10, 14, 39, 0.95);
        backdrop-filter: blur(15px);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 16px;
        padding: 20px;
        overflow-y: auto;
        z-index: 100;
        opacity: 0;
        transform: translateX(20px);
        transition: all 0.3s ease;
        scrollbar-width: thin;
        scrollbar-color: rgba(0, 217, 255, 0.3) transparent;
    }

    .tion-toc-sidebar.visible {
        opacity: 1;
        transform: translateX(0);
    }

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

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

    .tion-toc-sidebar::-webkit-scrollbar-thumb {
        background: rgba(0, 217, 255, 0.3);
        border-radius: 4px;
    }

    .tion-toc-title {
        font-size: 13px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 1px;
        color: #00D9FF;
        margin-bottom: 14px;
        padding-bottom: 10px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .tion-toc-list {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .tion-toc-item {
        margin-bottom: 4px;
    }

    .tion-toc-link {
        display: block;
        padding: 8px 12px;
        font-size: 13px;
        color: #718096;
        text-decoration: none;
        border-radius: 8px;
        transition: all 0.2s ease;
        border-left: 2px solid transparent;
        line-height: 1.4;
    }

    .tion-toc-link:hover {
        color: #A0AEC0;
        background: rgba(255, 255, 255, 0.04);
    }

    .tion-toc-link.active {
        color: #00D9FF;
        background: rgba(0, 217, 255, 0.08);
        border-left-color: #00D9FF;
    }

    .tion-toc-link[data-level="3"] {
        padding-left: 24px;
        font-size: 12px;
    }

    /* ===== READING TIME BADGE ===== */
    .tion-reading-time-badge {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 8px 16px;
        background: rgba(0, 217, 255, 0.08);
        border: 1px solid rgba(0, 217, 255, 0.15);
        border-radius: 50px;
        font-size: 14px;
        color: #00D9FF;
        margin-bottom: 24px;
        font-weight: 500;
    }

    .tion-reading-time-badge .material-icons-round {
        font-size: 16px;
    }

    /* ===== KEYBOARD SHORTCUTS HINT ===== */
    .tion-shortcuts-hint {
        position: fixed;
        bottom: 32px;
        left: 32px;
        background: rgba(10, 14, 39, 0.95);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 14px;
        padding: 16px 20px;
        z-index: 9998;
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
        transition: all 0.3s ease;
        max-width: 280px;
    }

    .tion-shortcuts-hint.visible {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .tion-shortcuts-hint-title {
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 1px;
        color: #00D9FF;
        margin-bottom: 10px;
        font-weight: 700;
    }

    .tion-shortcut-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 0;
        font-size: 13px;
        color: #A0AEC0;
    }

    .tion-shortcut-keys {
        display: flex;
        gap: 4px;
    }

    .tion-shortcut-key {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 24px;
        height: 22px;
        padding: 0 6px;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.15);
        border-radius: 4px;
        font-size: 11px;
        font-weight: 600;
        color: #E2E8F0;
        font-family: 'Fira Code', monospace;
    }

    /* ===== CONTENT ENHANCEMENTS ===== */
    /* Wider content area for single posts */
    .tion-single-post .wp-block-post-content,
    .tion-single-post .entry-content {
        max-width: 780px;
        font-size: 17px;
        line-height: 1.85;
    }

    /* Enhanced blockquotes */
    .tion-single-post blockquote,
    .tion-single-post .wp-block-quote {
        background: rgba(0, 217, 255, 0.04);
        border-left: 4px solid #0066FF;
        border-radius: 0 12px 12px 0;
        padding: 20px 24px;
    }

    /* Enhanced code blocks */
    .tion-single-post .wp-block-code {
        border-radius: 12px;
        border: 1px solid rgba(255, 255, 255, 0.08);
    }

    /* ===== POST NAVIGATION ENHANCEMENT ===== */
    .tion-post-nav {
        display: flex;
        justify-content: space-between;
        gap: 20px;
        margin-top: 60px;
        padding-top: 40px;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .tion-post-nav-item {
        flex: 1;
        padding: 20px;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.06);
        border-radius: 14px;
        text-decoration: none;
        color: inherit;
        transition: all 0.3s ease;
    }

    .tion-post-nav-item:hover {
        background: rgba(0, 217, 255, 0.05);
        border-color: rgba(0, 217, 255, 0.2);
        transform: translateY(-2px);
    }

    /* ===== HOVER EFFECTS FOR LINKS ===== */
    .wp-block-post-content a:not(.wp-block-button__link),
    .entry-content a:not(.wp-block-button__link) {
        color: #00D9FF;
        text-decoration: none;
        background-image: linear-gradient(135deg, #00D9FF, #0066FF);
        background-size: 0% 2px;
        background-repeat: no-repeat;
        background-position: left bottom;
        transition: background-size 0.3s ease;
    }

    .wp-block-post-content a:not(.wp-block-button__link):hover,
    .entry-content a:not(.wp-block-button__link):hover {
        background-size: 100% 2px;
    }

    /* ===== SMOOTH SCROLLBAR ===== */
    ::-webkit-scrollbar {
        width: 8px;
    }

    ::-webkit-scrollbar-track {
        background: #0A0E27;
    }

    ::-webkit-scrollbar-thumb {
        background: rgba(0, 217, 255, 0.2);
        border-radius: 4px;
    }

    ::-webkit-scrollbar-thumb:hover {
        background: rgba(0, 217, 255, 0.4);
    }

    /* ===== SELECTION COLOR ===== */
    ::selection {
        background: rgba(0, 102, 255, 0.3);
        color: white;
    }

    ::-moz-selection {
        background: rgba(0, 102, 255, 0.3);
        color: white;
    }
}

/* ===== PWA Install Banner (PC) ===== */
.tion-pwa-install-banner {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    z-index: 10000;
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 16px;
    padding: 0;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.tion-pwa-install-banner.visible {
    transform: translateX(-50%) translateY(0);
}

.tion-pwa-install-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
}

.tion-pwa-install-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #0066FF, #00D9FF);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tion-pwa-install-icon .material-icons-round {
    color: white;
    font-size: 24px;
}

.tion-pwa-install-text {
    display: flex;
    flex-direction: column;
}

.tion-pwa-install-text strong {
    font-size: 14px;
    color: white;
    font-weight: 700;
}

.tion-pwa-install-text span {
    font-size: 12px;
    color: #A0AEC0;
}

.tion-pwa-install-btn {
    padding: 10px 24px;
    background: linear-gradient(135deg, #0066FF, #00D9FF);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: inherit;
}

.tion-pwa-install-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 102, 255, 0.4);
}

.tion-pwa-install-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    color: #718096;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    padding: 0;
}

.tion-pwa-install-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}
