/* ==========================================================================
   DKB Learn - Frontend Styles
   Brand Colors:
   - Dark:    #000000, #282829
   - Grays:   #6b6b6a, #969697
   - Lights:  #f1f2f2, #ffffff
   - Reds:    #811424, #ca2036
   - Blues:    #1e3060, #24457c, #27599a, #2e6eb7, #358ccb, #3caae1
   ========================================================================== */

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html.dkb-learn-body,
html {
    margin: 0 !important;
    padding: 0 !important;
}

.dkb-learn-body {
    font-family: 'Rubik', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #ffffff;
    color: #282829;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
    height: 100vh;
}

/* Hide WP admin bar and any theme elements on this page */
.dkb-learn-body #wpadminbar {
    display: none !important;
}
.dkb-learn-body.admin-bar {
    margin-top: 0 !important;
    padding-top: 0 !important;
}
.dkb-learn-body.admin-bar .dkb-learn-wrapper {
    padding-top: 0;
}
.dkb-learn-body header:not(.dkb-mobile-header),
.dkb-learn-body .site-header,
.dkb-learn-body #masthead,
.dkb-learn-body .wp-site-header,
.dkb-learn-body nav:not(.dkb-learn-nav) {
    display: none !important;
}
/* Kill any WP admin bar margin/padding on html or body */
html[lang],
html {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Layout */
.dkb-learn-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ==========================================================================
   Mobile Header
   ========================================================================== */
.dkb-mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #1e3060;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    align-items: center;
    padding: 0 16px;
}

.dkb-menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.dkb-menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #f1f2f2;
    border-radius: 1px;
    transition: transform 0.2s ease;
}

.dkb-mobile-logo {
    margin-left: 12px;
    height: 40px;
    display: flex;
    align-items: center;
    padding: 4px 12px;
}

.dkb-mobile-logo .dkb-logo-img {
    height: 32px;
    width: auto;
    max-width: none;
}

/* ==========================================================================
   Sidebar
   ========================================================================== */
.dkb-learn-sidebar {
    width: 280px;
    min-width: 280px;
    background: #1e3060;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.dkb-sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.dkb-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 20px;
}

.dkb-logo-img {
    max-width: 170px;
    height: auto;
}

/* Navigation */
.dkb-learn-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.dkb-learn-nav::-webkit-scrollbar {
    width: 4px;
}

.dkb-learn-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.dkb-topic-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 24px;
    color: #d1d1d1;
    text-decoration: none;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
}

.dkb-topic-link:hover {
    color: #ffffff;
    background: rgba(46, 110, 183, 0.12);
}

.dkb-topic-link.active {
    color: #ffffff;
    background: rgba(46, 110, 183, 0.18);
    border-left-color: #358ccb;
}

.dkb-topic-number {
    font-size: 14px;
    font-weight: 700;
    color: #358ccb;
    min-width: 24px;
    font-variant-numeric: tabular-nums;
}

.dkb-topic-link:hover .dkb-topic-number {
    color: #3caae1;
}

.dkb-topic-link.active .dkb-topic-number {
    color: #3caae1;
}

.dkb-topic-title {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
}

/* Topic Groups (nested menus) */
.dkb-topic-group {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.dkb-group-toggle {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px 24px;
    background: none;
    border: none;
    color: #d1d1d1;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
    font-family: inherit;
}

.dkb-group-toggle:hover {
    color: #ffffff;
    background: rgba(46, 110, 183, 0.12);
}

.dkb-group-toggle:hover .dkb-topic-number {
    color: #3caae1;
}

.dkb-topic-group.open .dkb-group-toggle {
    color: #ffffff;
    background: rgba(46, 110, 183, 0.08);
}

.dkb-toggle-icon {
    margin-left: auto;
    width: 18px;
    height: 18px;
    position: relative;
    flex-shrink: 0;
}

.dkb-toggle-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid #6b6b6a;
    border-bottom: 2px solid #6b6b6a;
    transform: translate(-50%, -65%) rotate(45deg);
    transition: transform 0.2s ease;
}

.dkb-topic-group.open .dkb-toggle-icon::before {
    transform: translate(-50%, -35%) rotate(-135deg);
}

.dkb-group-toggle:hover .dkb-toggle-icon::before {
    border-color: #969697;
}

.dkb-group-children {
    overflow: hidden;
    transition: max-height 0.25s ease;
}

.dkb-group-children[hidden] {
    display: block;
    max-height: 0;
    visibility: hidden;
}

.dkb-child-link {
    padding-left: 48px;
    font-size: 14px;
    border-left: 3px solid transparent;
}

.dkb-child-link .dkb-topic-title {
    font-size: 14px;
    font-weight: 400;
    color: #b0b0b0;
}

.dkb-child-link:hover .dkb-topic-title,
.dkb-child-link.active .dkb-topic-title {
    color: #ffffff;
}

.dkb-no-topics {
    padding: 24px;
    color: #6b6b6a;
    font-size: 14px;
    font-style: italic;
}

/* Sidebar Footer */
.dkb-sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    transition: padding-bottom 0.3s;
}

.dkb-has-cookie-banner .dkb-sidebar-footer {
    padding-bottom: 60px;
}

.dkb-cares-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.dkb-cares-img {
    max-width: 200px;
    height: auto;
}

/* Sidebar Overlay (mobile) */
.dkb-sidebar-overlay {
    display: none;
}

/* ==========================================================================
   Main Content
   ========================================================================== */
.dkb-learn-content {
    flex: 1;
    overflow-y: auto;
    padding: 48px 64px;
    background: #ffffff;
    scrollbar-width: thin;
    scrollbar-color: #d1d1d1 transparent;
}

.dkb-learn-content::-webkit-scrollbar {
    width: 6px;
}

.dkb-learn-content::-webkit-scrollbar-thumb {
    background: #d1d1d1;
    border-radius: 3px;
}

/* Topic Panel */
.dkb-topic-panel {
    max-width: 900px;
    margin: 0 auto;
    animation: dkb-fadeIn 0.2s ease;
}

@keyframes dkb-fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.dkb-topic-header {
    margin-bottom: 32px;
}

.dkb-topic-badge {
    display: inline-block;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #2e6eb7;
    margin-bottom: 8px;
}

.dkb-topic-heading {
    font-family: 'Montserrat', sans-serif;
    font-size: 36px;
    font-weight: 800;
    color: #1e3060;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

/* Video */
.dkb-video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    background: #f1f2f2;
    margin-bottom: 40px;
    border: 1px solid #e0e0e0;
}

.dkb-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 12px;
}

/* Topic Body (block editor content) */
.dkb-topic-body {
    font-family: 'Rubik', sans-serif;
    color: #282829;
    font-size: 16px;
    line-height: 1.8;
}

.dkb-topic-body h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: #1e3060;
    margin: 40px 0 16px;
}

.dkb-topic-body h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: #1e3060;
    margin: 32px 0 12px;
}

.dkb-topic-body p {
    margin-bottom: 16px;
}

.dkb-topic-body a {
    color: #2e6eb7;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.dkb-topic-body a:hover {
    color: #1e3060;
}

.dkb-topic-body ul,
.dkb-topic-body ol {
    margin: 0 0 16px 24px;
}

.dkb-topic-body li {
    margin-bottom: 6px;
}

.dkb-topic-body blockquote {
    border-left: 3px solid #2e6eb7;
    padding: 12px 20px;
    margin: 24px 0;
    background: rgba(30, 48, 96, 0.04);
    border-radius: 0 8px 8px 0;
    color: #6b6b6a;
}

.dkb-topic-body code {
    background: #f1f2f2;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 14px;
    color: #1e3060;
}

.dkb-topic-body pre {
    background: #f1f2f2;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 24px 0;
    border: 1px solid #e0e0e0;
}

.dkb-topic-body pre code {
    background: none;
    padding: 0;
}

.dkb-topic-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 16px 0;
}

.dkb-topic-body hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 32px 0;
}

/* Empty State */
.dkb-empty-state {
    text-align: center;
    padding: 120px 40px;
}

.dkb-empty-state h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 32px;
    font-weight: 800;
    color: #1e3060;
    margin-bottom: 12px;
}

.dkb-empty-state p {
    color: #6b6b6a;
    font-size: 16px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
    .dkb-learn-content {
        padding: 40px 40px;
    }

    .dkb-topic-heading {
        font-size: 28px;
    }
}

@media (max-width: 768px) {
    .dkb-mobile-header {
        display: flex;
    }

    .dkb-learn-wrapper {
        flex-direction: column;
    }

    .dkb-learn-sidebar {
        position: fixed;
        top: 56px;
        left: -280px;
        z-index: 999;
        transition: left 0.25s ease;
        height: calc(100vh - 56px);
    }

    .dkb-learn-sidebar .dkb-sidebar-header {
        display: none;
    }

    .dkb-learn-sidebar.open {
        left: 0;
    }

    .dkb-learn-content {
        transition: opacity 0.25s ease;
    }

    .sidebar-open .dkb-learn-content {
        opacity: 0.15;
    }

    .dkb-learn-content {
        padding: 72px 20px 40px;
        height: 100vh;
    }

    .dkb-topic-heading {
        font-size: 24px;
    }

    .dkb-topic-header {
        margin-bottom: 24px;
    }

    .dkb-video-wrapper {
        margin-bottom: 28px;
        border-radius: 8px;
    }

    .dkb-video-wrapper iframe {
        border-radius: 8px;
    }
}

@media (max-width: 480px) {
    .dkb-learn-content {
        padding: 64px 16px 32px;
    }

    .dkb-topic-heading {
        font-size: 22px;
    }

    .dkb-topic-body {
        font-size: 15px;
    }
}

/* Cookie Consent Banner */
.dkb-cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 14px 24px;
    background: #1e3060;
    color: #ffffff;
    font-family: 'Rubik', sans-serif;
    font-size: 13px;
    z-index: 9999;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.15);
}

.dkb-cookie-banner p {
    margin: 0;
    line-height: 1.4;
}

#dkb-cookie-accept {
    flex-shrink: 0;
    padding: 8px 20px;
    background: #3caae1;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

#dkb-cookie-accept:hover {
    background: #358ccb;
}

@media (max-width: 768px) {
    .dkb-cookie-banner {
        flex-direction: column;
        text-align: center;
        gap: 10px;
        padding: 12px 16px;
        font-size: 12px;
    }
}
