/* ============================================
   KOHARdsi — Main Application Stylesheet
   Modern App-Like WordPress Theme
   ============================================ */

/* ============================================
   1. BASE & RESET
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg-base);
    color: var(--color-text-primary);
    line-height: 1.6;
    padding-top: var(--header-height-mobile);
    transition: background-color var(--transition-base), color var(--transition-base);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@media (min-width: 992px) {
    body {
        padding-top: var(--header-height);
    }
}

@media (max-width: 991.98px) {
    body {
        padding-bottom: var(--bottom-nav-height);
    }
}

a {
    color: var(--color-primary);
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-hover);
}

img {
    max-width: 100%;
    height: auto;
}

::selection {
    background: rgba(var(--color-primary-rgb), 0.2);
    color: var(--color-text-primary);
}

/* ============================================
   2. TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-sans);
    color: var(--color-text-primary);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

h1 { font-weight: 800; }
h2 { font-weight: 700; }

.section-title {
    font-weight: 700;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title::after {
    content: '';
    display: inline-block;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    border-radius: 3px;
    margin-left: 0.75rem;
}

.gradient-text {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   3. APP BAR / HEADER
   ============================================ */
.app-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height-mobile);
    z-index: 1030;
    border-bottom: 1px solid var(--color-border);
    transition: all var(--transition-base);
}

@media (min-width: 992px) {
    .app-bar {
        height: var(--header-height);
    }
}

.app-bar .container {
    height: 100%;
}

.app-bar .navbar {
    height: 100%;
    padding: 0;
}

.app-bar .navbar-brand {
    font-weight: 700;
    text-decoration: none;
    padding: 0;
}

.app-bar .navbar-brand .custom-logo {
    max-height: 36px;
    width: auto;
}

/* Nav Links */
.app-bar .navbar-nav .nav-link {
    color: var(--color-text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    position: relative;
    transition: color var(--transition-fast);
}

.app-bar .navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 20px;
    height: 2px;
    background: var(--color-primary);
    border-radius: 2px;
    transition: transform var(--transition-base);
}

.app-bar .navbar-nav .nav-link:hover,
.app-bar .navbar-nav .nav-link.active,
.app-bar .navbar-nav .current-menu-item > .nav-link {
    color: var(--color-primary);
}

.app-bar .navbar-nav .nav-link:hover::after,
.app-bar .navbar-nav .nav-link.active::after,
.app-bar .navbar-nav .current-menu-item > .nav-link::after {
    transform: translateX(-50%) scaleX(1);
}

/* Icon Buttons */
.btn-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    border: none;
    background: transparent;
    color: var(--color-text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    padding: 0;
}

.btn-icon:hover {
    background: rgba(var(--color-primary-rgb), 0.1);
    color: var(--color-primary);
}

/* Theme toggle icons */
[data-theme="light"] .theme-icon-dark,
[data-theme="dark"] .theme-icon-light {
    display: none;
}

[data-theme="light"] .theme-icon-light,
[data-theme="dark"] .theme-icon-dark {
    display: inline-block;
}

/* ============================================
   4. GLASSMORPHISM
   ============================================ */
.glass {
    background: rgba(var(--color-bg-surface, 255, 255, 255), 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

[data-theme="light"] .glass {
    background: rgba(255, 255, 255, 0.88);
}

[data-theme="dark"] .glass {
    background: rgba(26, 26, 46, 0.88);
}

.glass-dark {
    background: rgba(15, 15, 35, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

/* ============================================
   5. BOTTOM NAVIGATION
   ============================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 1030;
    padding-bottom: env(safe-area-inset-bottom, 0);
    transition: background var(--transition-base);
}

[data-theme="dark"] .bottom-nav {
    background: rgba(26, 26, 46, 0.92);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--color-text-muted);
    font-size: 0.625rem;
    font-weight: 500;
    gap: 2px;
    position: relative;
    padding: 4px 12px;
    transition: color var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item i {
    font-size: 1.25rem;
    transition: transform var(--transition-fast);
}

.bottom-nav-item.active {
    color: var(--color-primary);
}

.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--color-primary);
    border-radius: 0 0 3px 3px;
}

.bottom-nav-item.active i {
    transform: scale(1.1);
}

.bottom-nav-item:hover {
    color: var(--color-primary);
}

/* ============================================
   6. HERO SECTION
   ============================================ */
.hero-section {
    min-height: 80vh;
    background: linear-gradient(135deg, var(--color-primary) 0%, #4338ca 50%, var(--color-secondary) 100%);
    position: relative;
    overflow: hidden;
    margin-top: calc(var(--header-height-mobile) * -1);
    padding-top: var(--header-height-mobile);
    display: flex;
    align-items: center;
}

@media (min-width: 992px) {
    .hero-section {
        min-height: 70vh;
        margin-top: calc(var(--header-height) * -1);
        padding-top: var(--header-height);
    }
}

.hero-title {
    color: #fff;
    text-shadow: 0 2px 20px rgba(0,0,0,0.2);
}

/* Floating shapes */
.hero-shapes {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.hero-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    background: #fff;
}

.hero-shape-1 {
    width: 300px;
    height: 300px;
    top: -50px;
    right: -50px;
    animation: float 8s ease-in-out infinite;
}

.hero-shape-2 {
    width: 200px;
    height: 200px;
    bottom: 10%;
    left: 5%;
    animation: float 6s ease-in-out infinite reverse;
}

.hero-shape-3 {
    width: 150px;
    height: 150px;
    top: 40%;
    right: 15%;
    animation: float 7s ease-in-out infinite 1s;
}

/* Typing cursor */
.typing-cursor {
    display: inline-block;
    animation: blink 0.8s step-end infinite;
    color: var(--color-accent);
    font-weight: 300;
}

/* ============================================
   7. CARDS
   ============================================ */
.card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-bg-surface);
    overflow: hidden;
    transition: all var(--transition-base);
}

.card-hover {
    cursor: pointer;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-border-hover);
}

.card-hover:hover .card-img-wrapper img {
    transform: scale(1.05);
}

.card-img-wrapper {
    overflow: hidden;
}

.card-img-wrapper img {
    transition: transform 0.4s ease;
}

.card .card-header {
    background: var(--color-bg-elevated);
    border-bottom: 1px solid var(--color-border);
}

/* ============================================
   8. BADGES & TAGS
   ============================================ */
.badge-primary {
    background: rgba(var(--color-primary-rgb), 0.15);
    color: var(--color-primary);
    font-weight: 600;
    font-size: 0.75rem;
    border-radius: var(--radius-full);
}

.badge-secondary {
    background: rgba(var(--color-secondary-rgb), 0.15);
    color: var(--color-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    border-radius: var(--radius-full);
}

.badge-accent {
    background: rgba(var(--color-accent-rgb), 0.15);
    color: var(--color-accent);
    font-weight: 600;
    font-size: 0.75rem;
    border-radius: var(--radius-full);
}

/* ============================================
   9. BUTTONS
   ============================================ */
.btn-primary-custom {
    background: linear-gradient(135deg, var(--color-primary), #4338ca);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    padding: 0.6rem 1.5rem;
    transition: all var(--transition-fast);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary-custom:hover {
    background: linear-gradient(135deg, var(--color-primary-hover), #3730a3);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(var(--color-primary-rgb), 0.4);
}

.btn-primary-custom:active {
    transform: scale(0.97);
}

.btn-outline-custom {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
    border-radius: var(--radius-md);
    font-weight: 600;
    padding: calc(0.6rem - 2px) calc(1.5rem - 2px);
    transition: all var(--transition-fast);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-outline-custom:hover {
    background: var(--color-primary);
    color: #fff;
    transform: translateY(-1px);
}

.btn-outline-custom:active {
    transform: scale(0.97);
}

/* ============================================
   10. SINGLE POST / ARTICLE
   ============================================ */
.entry-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--color-text-primary);
}

.entry-content p {
    margin-bottom: 1.5rem;
}

.entry-content h2 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-border);
}

.entry-content h3 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.entry-content a {
    color: var(--color-primary);
    text-decoration: underline;
    text-decoration-color: rgba(var(--color-primary-rgb), 0.3);
    text-underline-offset: 3px;
    transition: text-decoration-color var(--transition-fast);
}

.entry-content a:hover {
    text-decoration-color: var(--color-primary);
}

.entry-content img {
    border-radius: var(--radius-md);
    margin: 1rem 0;
}

.entry-content blockquote {
    border-left: 4px solid var(--color-primary);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: rgba(var(--color-primary-rgb), 0.05);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-style: italic;
    color: var(--color-text-secondary);
}

.entry-content ul,
.entry-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.entry-content li {
    margin-bottom: 0.5rem;
}

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.entry-content table th,
.entry-content table td {
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
}

.entry-content table th {
    background: var(--color-bg-elevated);
    font-weight: 600;
}

/* Reading Progress Bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    z-index: 1040;
    transition: width 50ms linear;
}

/* Table of Contents */
.toc {
    font-size: 0.875rem;
}

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

.toc ul ul {
    padding-left: 1rem;
}

.toc li {
    margin-bottom: 0.5rem;
}

.toc a {
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
    display: block;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    border-left: 2px solid transparent;
}

.toc a:hover,
.toc a.active {
    color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.05);
    border-left-color: var(--color-primary);
}

/* Entry Meta */
.entry-meta {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.entry-meta a {
    color: var(--color-text-secondary);
    text-decoration: none;
}

.entry-meta a:hover {
    color: var(--color-primary);
}

/* Author Bio */
.author-bio {
    border-left: 3px solid var(--color-primary);
}

/* Post Navigation */
.post-navigation .card {
    transition: all var(--transition-fast);
}

.post-navigation .card:hover {
    border-color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.03);
}

/* ============================================
   11. CODE BLOCKS & SYNTAX
   ============================================ */
pre[class*="language-"],
.entry-content pre {
    border-radius: var(--radius-md);
    margin: 1.5rem 0;
    font-size: 0.875rem;
    position: relative;
}

code {
    font-family: var(--font-mono);
    font-size: 0.875em;
}

:not(pre) > code {
    background: rgba(var(--color-primary-rgb), 0.1);
    color: var(--color-primary);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-size: 0.85em;
}

.code-copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-sans);
    z-index: 5;
}

.code-copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.code-copy-btn.copied {
    background: var(--color-success);
    color: #fff;
    border-color: var(--color-success);
}

/* ============================================
   12. SEARCH OVERLAY
   ============================================ */
.search-overlay {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(10px);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
}

.search-overlay.active {
    display: flex;
    animation: fadeIn var(--transition-slow);
}

.search-overlay-inner {
    width: 100%;
    max-width: 600px;
    padding: 0 1.5rem;
    position: relative;
}

.search-overlay-close {
    position: absolute;
    top: -60px;
    right: 1.5rem;
    color: rgba(255,255,255,0.7);
}

.search-overlay-close:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.search-overlay-title {
    color: #fff;
    font-weight: 700;
    font-size: 1.5rem;
}

.search-overlay .search-form input[type="search"],
.search-overlay .search-form input[type="text"] {
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.2);
    color: #fff;
    font-size: 1.25rem;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    width: 100%;
    outline: none;
    transition: border-color var(--transition-fast);
}

.search-overlay .search-form input:focus {
    border-color: var(--color-primary);
}

.search-overlay .search-form input::placeholder {
    color: rgba(255,255,255,0.4);
}

/* ============================================
   13. SIDEBAR & WIDGETS
   ============================================ */
.widget {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-bg-surface);
    overflow: hidden;
}

.widget-title {
    font-size: 0.95rem;
    padding: 1rem 1.25rem;
    margin: 0;
    background: var(--color-bg-elevated);
    border-bottom: 1px solid var(--color-border);
}

.popular-post-number {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: rgba(var(--color-primary-rgb), 0.1);
    color: var(--color-primary);
    font-weight: 700;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.popular-post-link {
    color: var(--color-text-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.popular-post-link:hover {
    color: var(--color-primary);
}

/* ============================================
   14. FOOTER
   ============================================ */
.site-footer {
    background: var(--color-bg-surface);
    border-top: 1px solid var(--color-border);
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

@media (max-width: 991.98px) {
    .site-footer {
        padding-bottom: calc(var(--bottom-nav-height) + 1.5rem);
    }
}

.footer-widget h6 {
    color: var(--color-text-primary);
    font-weight: 700;
    margin-bottom: 1rem;
}

.social-link {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: rgba(var(--color-primary-rgb), 0.1);
    color: var(--color-primary);
    font-size: 1.1rem;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.social-link:hover {
    background: var(--color-primary);
    color: #fff;
    transform: translateY(-2px);
}

.footer-copyright {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

/* ============================================
   15. COMMENTS
   ============================================ */
.comment-list {
    list-style: none;
    padding: 0;
}

.comment-list .comment {
    margin-bottom: 1.5rem;
}

.comment-list .children {
    list-style: none;
    padding-left: 2rem;
    border-left: 2px solid var(--color-border);
    margin-top: 1rem;
}

.comment-body {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
}

.comment-meta {
    margin-bottom: 0.75rem;
}

.comment-author img {
    border-radius: var(--radius-full);
    margin-right: 0.5rem;
}

/* ============================================
   16. 404 PAGE
   ============================================ */
.error-404 .display-1 {
    font-size: 8rem;
    font-weight: 900;
    line-height: 1;
}

@media (min-width: 768px) {
    .error-404 .display-1 {
        font-size: 12rem;
    }
}

/* ============================================
   17. ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-24px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes blink {
    50% { opacity: 0; }
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn var(--transition-slow) ease forwards;
}

.fade-in-up {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-up.revealed {
    opacity: 1;
    transform: translateY(0);
}

.stagger-item {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s ease forwards;
}

/* ============================================
   18. MOBILE OFF-CANVAS
   ============================================ */
.offcanvas {
    background: var(--color-bg-surface);
    border-right: 1px solid var(--color-border);
    max-width: 300px;
}

.offcanvas-header {
    border-bottom: 1px solid var(--color-border);
}

.mobile-menu-list .nav-link {
    color: var(--color-text-primary);
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
}

.mobile-menu-list .nav-link:hover {
    background: rgba(var(--color-primary-rgb), 0.08);
    color: var(--color-primary);
}

.mobile-menu-list .current-menu-item > .nav-link {
    background: rgba(var(--color-primary-rgb), 0.1);
    color: var(--color-primary);
}

/* ============================================
   19. FILTER TABS
   ============================================ */
.filter-tabs {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.filter-tabs::-webkit-scrollbar {
    display: none;
}

/* ============================================
   20. STATS COUNTER
   ============================================ */
.stats-section {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

/* ============================================
   21. PORTFOLIO CARD
   ============================================ */
.portfolio-card:hover .portfolio-card-overlay {
    opacity: 1 !important;
}

.portfolio-card:hover .portfolio-card-img img {
    transform: scale(1.08);
}

/* ============================================
   22. BREADCRUMB
   ============================================ */
.breadcrumb-nav .breadcrumb {
    background: transparent;
    padding: 0;
    font-size: 0.85rem;
}

.breadcrumb-nav .breadcrumb-item a {
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.breadcrumb-nav .breadcrumb-item a:hover {
    color: var(--color-primary);
}

.breadcrumb-nav .breadcrumb-item.active {
    color: var(--color-text-secondary);
}

.breadcrumb-nav .breadcrumb-item + .breadcrumb-item::before {
    color: var(--color-text-muted);
}

/* ============================================
   23. SHARE BUTTONS
   ============================================ */
.share-btn {
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    transition: all var(--transition-fast);
}

.share-btn:hover {
    transform: translateY(-2px);
}

/* ============================================
   24. BACK TO TOP
   ============================================ */
.back-to-top {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    color: #fff;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-base);
    z-index: 1020;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

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

.back-to-top:hover {
    background: var(--color-primary-hover);
    transform: translateY(-2px);
}

@media (min-width: 992px) {
    .back-to-top {
        bottom: 30px;
        right: 30px;
    }
}

/* ============================================
   25. PWA INSTALL BANNER
   ============================================ */
.install-banner {
    position: fixed;
    bottom: 70px;
    left: 1rem;
    right: 1rem;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    display: none;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-xl);
    z-index: 1025;
    animation: fadeInUp 0.4s ease;
}

@media (min-width: 992px) {
    .install-banner {
        bottom: 1.5rem;
        left: auto;
        right: 1.5rem;
        max-width: 380px;
    }
}

.install-banner.show {
    display: flex;
}

.install-banner-text {
    flex-grow: 1;
}

.install-banner-text strong {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.15rem;
}

.install-banner-text small {
    color: var(--color-text-muted);
}

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

/* ============================================
   27. PAGINATION
   ============================================ */
.pagination .page-item .page-link,
.pagination .page-item .page-numbers {
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    border-radius: var(--radius-sm);
    margin: 0 2px;
    padding: 0.5rem 0.85rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    background: var(--color-bg-surface);
}

.pagination .page-item.active .page-link,
.pagination .page-item.active .page-numbers,
.pagination .page-item .page-numbers.current {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.pagination .page-item .page-link:hover,
.pagination .page-item .page-numbers:hover {
    background: rgba(var(--color-primary-rgb), 0.1);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* ============================================
   28. HOMEPAGE SECTIONS
   ============================================ */
.home-section {
    padding: 3rem 0;
}

.home-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.home-section-header .view-all {
    color: var(--color-primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: color var(--transition-fast);
}

.home-section-header .view-all:hover {
    color: var(--color-primary-hover);
}

/* Horizontal scroll container */
.scroll-container {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 0.5rem;
}

.scroll-container::-webkit-scrollbar {
    display: none;
}

.scroll-container > .card {
    min-width: 280px;
    max-width: 320px;
    scroll-snap-align: start;
    flex-shrink: 0;
}

/* ============================================
   29. DARK MODE OVERRIDES
   ============================================ */
[data-theme="dark"] .card {
    background: var(--color-bg-surface);
    border-color: var(--color-border);
}

[data-theme="dark"] .offcanvas {
    background: var(--color-bg-surface);
    border-color: var(--color-border);
}

[data-theme="dark"] .btn-close {
    filter: invert(1);
}

[data-theme="dark"] img:not([src*=".svg"]) {
    filter: brightness(0.92);
}

[data-theme="dark"] .entry-content blockquote {
    background: rgba(var(--color-primary-rgb), 0.08);
}

[data-theme="dark"] .stats-section {
    background: var(--color-bg-surface);
    border-color: var(--color-border);
}

[data-theme="dark"] :not(pre) > code {
    background: rgba(var(--color-primary-rgb), 0.15);
}

[data-theme="dark"] .portfolio-hero-overlay {
    background: linear-gradient(to top, var(--color-bg-base) 0%, rgba(0,0,0,0.7) 100%) !important;
}

/* ============================================
   30. RESPONSIVE
   ============================================ */
@media (max-width: 575.98px) {
    .display-4 { font-size: 2rem; }
    .display-5 { font-size: 1.75rem; }
    .display-6 { font-size: 1.4rem; }

    .hero-section {
        min-height: 70vh;
        text-align: center;
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .hero-cta .btn {
        width: 100%;
        max-width: 280px;
    }

    .stat-number {
        font-size: 1.75rem;
    }

    .entry-content {
        font-size: 1rem;
    }

    .single-tutorial .col-lg-4,
    .single-tool .col-lg-4 {
        margin-top: 2rem;
    }
}

@media (max-width: 767.98px) {
    .home-section {
        padding: 2rem 0;
    }
}

/* ============================================
   31. PRINT
   ============================================ */
@media print {
    .app-bar,
    .bottom-nav,
    .back-to-top,
    .install-banner,
    .search-overlay,
    .share-buttons,
    .related-posts,
    .post-navigation,
    .comment-respond,
    .reading-progress,
    .toc,
    .offcanvas,
    .site-footer {
        display: none !important;
    }

    body {
        padding-top: 0;
        padding-bottom: 0;
        color: #000;
        background: #fff;
    }

    .card {
        border: 1px solid #ddd;
        box-shadow: none;
    }

    a {
        color: #000;
        text-decoration: underline;
    }
}
