/**
 * PinkCode LearnDash Beautifier - Tabs Module (Compact Edition)
 *
 * Sleek, compact tab navigation with beautiful custom icons
 * Optimized for mobile and desktop to keep focus on content
 * Using !important to override default LearnDash/theme styles
 */

.learndash-wrapper .ld-tabs {
    margin: 12px 0 !important;
}

.learndash-wrapper .ld-tabs-navigation {
    background: rgba(241, 245, 249, 0.6) !important;
    border-radius: 8px !important;
    padding: 4px !important;
    display: flex !important;
    gap: 4px !important;
    margin-bottom: 8px !important;
    border: 1px solid rgba(148, 163, 184, 0.15) !important;
    flex-wrap: wrap !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
}

.learndash-wrapper .ld-tabs-navigation .ld-tab {
    padding: 6px 12px !important;
    border-radius: 6px !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    font-weight: 500 !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
    color: #475569 !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    position: relative !important;
    white-space: nowrap !important;
    min-height: 28px !important;
    max-height: 28px !important;
    min-width: 90px !important;
}

.learndash-wrapper .ld-tabs-navigation .ld-tab .ld-text,
.learndash-wrapper .ld-tabs-navigation .ld-tab .ld-icon {
    color: inherit !important;
    transition: color 0.2s ease !important;
}

/* Enhanced Custom Icons with SVG backgrounds */
.learndash-wrapper .ld-tabs-navigation .ld-tab .ld-icon {
    width: 18px !important;
    height: 18px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    font-size: 0 !important; /* Hide default icon font */
    line-height: 1 !important;
}

/* Hide the default LearnDash icon font content */
.learndash-wrapper .ld-tabs-navigation .ld-tab .ld-icon::before {
    font-size: 0 !important;
    content: '' !important;
}

/* Content/Lesson icon - book with bookmark */
.learndash-wrapper .ld-tabs-navigation .ld-tab .ld-icon-content::before {
    content: '' !important;
    width: 18px !important;
    height: 18px !important;
    display: block !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20'/%3E%3Cpath d='M9 2v7l3-2 3 2V2'/%3E%3C/svg%3E") !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    font-size: 18px !important;
}

/* Materials icon - folder with documents */
.learndash-wrapper .ld-tabs-navigation .ld-tab .ld-icon-materials::before {
    content: '' !important;
    width: 18px !important;
    height: 18px !important;
    display: block !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z'/%3E%3Cpath d='M9 13h6'/%3E%3Cpath d='M9 17h3'/%3E%3C/svg%3E") !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    font-size: 18px !important;
}

/* Active state - darker icon color */
.learndash-wrapper .ld-tabs-navigation .ld-tab.ld-active .ld-icon-content::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23065f46' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20'/%3E%3Cpath d='M9 2v7l3-2 3 2V2'/%3E%3C/svg%3E") !important;
}

.learndash-wrapper .ld-tabs-navigation .ld-tab.ld-active .ld-icon-materials::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23065f46' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z'/%3E%3Cpath d='M9 13h6'/%3E%3Cpath d='M9 17h3'/%3E%3C/svg%3E") !important;
}

.learndash-wrapper .ld-tabs-navigation .ld-tab.ld-active {
    background: linear-gradient(135deg, rgba(167, 243, 208, 0.9) 0%, rgba(134, 239, 172, 0.85) 100%) !important;
    color: #065f46 !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

.learndash-wrapper .ld-tabs-navigation .ld-tab.ld-active .ld-text,
.learndash-wrapper .ld-tabs-navigation .ld-tab.ld-active .ld-icon {
    color: #065f46 !important;
}

.learndash-wrapper .ld-tabs-navigation .ld-tab:not(.ld-active):hover {
    background: rgba(226, 232, 240, 0.8) !important;
    color: #334155 !important;
}

.learndash-wrapper .ld-tabs-navigation .ld-tab:not(.ld-active):hover .ld-text,
.learndash-wrapper .ld-tabs-navigation .ld-tab:not(.ld-active):hover .ld-icon {
    color: #334155 !important;
}

.learndash-wrapper .ld-tabs-navigation .ld-tab:focus-visible {
    outline: 2px solid rgba(99, 102, 241, 0.5) !important;
    outline-offset: 2px !important;
}

.learndash-wrapper .ld-tabs-content {
    background: #ffffff !important;
    border-radius: 8px !important;
    padding: 12px !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06) !important;
}

/* Tablet optimization */
@media (max-width: 980px) {
    .learndash-wrapper .ld-tabs {
        margin: 8px 0 !important;
    }
    
    .learndash-wrapper .ld-tabs-navigation {
        padding: 3px !important;
        gap: 3px !important;
        margin-bottom: 6px !important;
    }

    .learndash-wrapper .ld-tabs-navigation .ld-tab {
        flex: 1 1 calc(50% - 3px) !important;
        padding: 5px 8px !important;
        font-size: 11px !important;
        min-width: 0 !important;
        min-height: 26px !important;
        max-height: 26px !important;
        gap: 5px !important;
    }
    
    .learndash-wrapper .ld-tabs-navigation .ld-tab .ld-icon {
        width: 16px !important;
        height: 16px !important;
    }
    
    .learndash-wrapper .ld-tabs-navigation .ld-tab .ld-icon-content::before,
    .learndash-wrapper .ld-tabs-navigation .ld-tab .ld-icon-materials::before {
        width: 16px !important;
        height: 16px !important;
        font-size: 16px !important;
    }

    .learndash-wrapper .ld-tabs-content {
        padding: 10px !important;
    }
}

/* Mobile optimization - ultra compact */
@media (max-width: 768px) {
    .learndash-wrapper .ld-tabs {
        margin: 6px 0 !important;
    }
    
    .learndash-wrapper .ld-tabs-navigation {
        padding: 2px !important;
        gap: 2px !important;
        margin-bottom: 4px !important;
        border-radius: 6px !important;
    }

    .learndash-wrapper .ld-tabs-navigation .ld-tab {
        flex: 1 1 calc(50% - 2px) !important;
        padding: 4px 6px !important;
        font-size: 10px !important;
        min-height: 24px !important;
        max-height: 24px !important;
        gap: 4px !important;
        border-radius: 4px !important;
    }
    
    .learndash-wrapper .ld-tabs-navigation .ld-tab .ld-icon {
        width: 14px !important;
        height: 14px !important;
    }
    
    .learndash-wrapper .ld-tabs-navigation .ld-tab .ld-icon-content::before,
    .learndash-wrapper .ld-tabs-navigation .ld-tab .ld-icon-materials::before {
        width: 14px !important;
        height: 14px !important;
        font-size: 14px !important;
    }

    .learndash-wrapper .ld-tabs-content {
        padding: 8px !important;
        border-radius: 6px !important;
    }
}

/* Extra small mobile - icon only mode option */
@media (max-width: 480px) {
    .learndash-wrapper .ld-tabs-navigation .ld-tab {
        padding: 4px 8px !important;
        min-width: 0 !important;
        justify-content: center !important;
    }
    
    /* Optional: Hide text on very small screens to save space */
    .learndash-wrapper .ld-tabs-navigation .ld-tab .ld-text {
        display: inline !important; /* Keep text visible by default */
    }
}

@media (prefers-reduced-motion: reduce) {
    .learndash-wrapper .ld-tab {
        transition: none !important;
    }
}
