/**
 * Unified Breadcrumb Styles
 * Consistent breadcrumb styling across all pages
 */

/* ==========================================================================
   Breadcrumb Container - Works for all variations
   ========================================================================== */

.breadcrumb-wrapper,
.breadcrumbs-wrapper,
.gptdetector-breadcrumbs {
    background: var(--bg-card, #FEFDFB);
    padding: 12px 20px;
    margin-bottom: 0;
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.06));
    position: relative;
    z-index: 10;
}

/* Ensure breadcrumbs stay above archive header on category/archive pages */
.archive-content .breadcrumbs-wrapper,
.archive-content .breadcrumb-wrapper {
    margin-bottom: 0;
    border-bottom: 1px solid var(--border-color, #D0CCC6);
}

/* Remove conflicting backgrounds */
.breadcrumb-wrapper::before,
.breadcrumbs-wrapper::before {
    display: none !important;
}

/* Light mode */
[data-theme="light"] .breadcrumb-wrapper,
[data-theme="light"] .breadcrumbs-wrapper,
[data-theme="light"] .gptdetector-breadcrumbs {
    background: #FEFDFB;
}

/* Dark mode */
[data-theme="dark"] .breadcrumb-wrapper,
[data-theme="dark"] .breadcrumbs-wrapper,
[data-theme="dark"] .gptdetector-breadcrumbs {
    background: #151B2C;
}

/* ==========================================================================
   Breadcrumb List
   ========================================================================== */

.breadcrumbs,
.breadcrumb-list {
    font-size: 0.9rem;
}

.breadcrumb-inner,
ul.breadcrumb-inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Breadcrumb Items */
.breadcrumb-item,
.breadcrumbs li.breadcrumb-item {
    display: inline-flex;
    align-items: center;
    position: relative;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Separator as list item */
li.breadcrumb-separator {
    display: inline-flex;
    align-items: center;
    margin: 0 8px;
    padding: 0;
    list-style: none;
    color: var(--text-muted, #adb5bd);
    font-weight: 300;
    user-select: none;
}

/* ==========================================================================
   Breadcrumb Links
   ========================================================================== */

.breadcrumb-link,
.breadcrumbs a,
.breadcrumb-item a {
    color: var(--text-secondary, #6c757d);
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.breadcrumb-link:hover,
.breadcrumbs a:hover,
.breadcrumb-item a:hover {
    color: var(--primary, #00D9FF);
    background: rgba(0, 217, 255, 0.05);
    transform: translateY(-1px);
    text-decoration: none;
}

/* Light mode links */
[data-theme="light"] .breadcrumb-link,
[data-theme="light"] .breadcrumbs a,
[data-theme="light"] .breadcrumb-item a {
    color: #6c757d;
}

[data-theme="light"] .breadcrumb-link:hover,
[data-theme="light"] .breadcrumbs a:hover,
[data-theme="light"] .breadcrumb-item a:hover {
    color: #00D9FF;
    background: rgba(0, 217, 255, 0.05);
}

/* Dark mode links */
[data-theme="dark"] .breadcrumb-link,
[data-theme="dark"] .breadcrumbs a,
[data-theme="dark"] .breadcrumb-item a {
    color: #94a3b8;
}

[data-theme="dark"] .breadcrumb-link:hover,
[data-theme="dark"] .breadcrumbs a:hover,
[data-theme="dark"] .breadcrumb-item a:hover {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.1);
}

/* ==========================================================================
   Current/Active Item
   ========================================================================== */

.breadcrumb-current,
.breadcrumbs .current,
.breadcrumb-item.current,
.breadcrumb-item:last-child:not(:first-child) {
    color: var(--text-primary, #212529);
    font-weight: 600;
    padding: 4px 10px;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 15px;
    border: none;
    pointer-events: none;
}

/* Light mode current */
[data-theme="light"] .breadcrumb-current,
[data-theme="light"] .breadcrumbs .current,
[data-theme="light"] .breadcrumb-item.current,
[data-theme="light"] .breadcrumb-item:last-child:not(:first-child) {
    color: #212529;
    background: #f8f9fa;
}

/* Dark mode current */
[data-theme="dark"] .breadcrumb-current,
[data-theme="dark"] .breadcrumbs .current,
[data-theme="dark"] .breadcrumb-item.current,
[data-theme="dark"] .breadcrumb-item:last-child:not(:first-child) {
    color: #ffffff;
    background: #334155;
}

/* ==========================================================================
   Separators
   ========================================================================== */

/* Remove any auto-generated separators or bullets */
.breadcrumb-item::before,
.breadcrumb-item::after,
.breadcrumbs li::before,
.breadcrumbs li::after {
    content: none;
}

/* Light mode separator */
[data-theme="light"] li.breadcrumb-separator {
    color: #adb5bd;
}

/* Dark mode separator */
[data-theme="dark"] li.breadcrumb-separator {
    color: #64748b;
}

/* ==========================================================================
   Icons
   ========================================================================== */

.breadcrumb-link i,
.breadcrumbs i {
    font-size: 0.9em;
    margin-right: 6px;
}

/* Home icon special styling */
.breadcrumb-item:first-child .breadcrumb-link i,
.breadcrumbs li:first-child i,
.fas.fa-home {
    color: var(--primary, #00D9FF);
    opacity: 1;
}


/* ==========================================================================
   Dashboard Specific Styles
   ========================================================================== */

.gptdetector-dashboard .breadcrumb-wrapper,
.gptdetector-dashboard .breadcrumbs-wrapper,
.dashboard-container .breadcrumb-wrapper,
.dashboard-container .breadcrumbs-wrapper {
    margin-bottom: 25px;
    background: var(--bg-card, #FEFDFB);
}

/* ==========================================================================
   Archive/Category Page Header Spacing
   ========================================================================== */

.archive-content .archive-header {
    background: var(--bg-card, #FEFDFB);
    padding: 60px 0 40px;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border-color, #D0CCC6);
}

/* Light mode archive header */
[data-theme="light"] .archive-content .archive-header {
    background: #FEFDFB;
}

/* Dark mode archive header */
[data-theme="dark"] .archive-content .archive-header {
    background: #151B2C;
}

/* ==========================================================================
   Page/Post Specific Styles
   ========================================================================== */

.single .breadcrumb-wrapper,
.single .breadcrumbs-wrapper,
.page .breadcrumb-wrapper,
.page .breadcrumbs-wrapper {
    margin-top: 20px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color, #D0CCC6);
}

/* ==========================================================================
   Remove Conflicting Styles
   ========================================================================== */

/* Override main.css gradient backgrounds */
.breadcrumbs-wrapper {
    background: var(--bg-card, #FEFDFB) !important;
    border: none !important;
    backdrop-filter: none !important;
}

/* Override blog-enhanced.css plain background */
.breadcrumb-wrapper {
    background: var(--bg-card, #FEFDFB) !important;
    border: none !important;
    border-bottom: 1px solid var(--border-color, #D0CCC6) !important;
}

/* Remove gradient overlays */
.breadcrumb-link::before,
.breadcrumb-current::after {
    display: none !important;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .breadcrumb-wrapper,
    .breadcrumbs-wrapper,
    .gptdetector-breadcrumbs {
        padding: 10px 15px;
        margin-bottom: 20px;
    }

    .breadcrumbs,
    .breadcrumb-inner,
    .breadcrumb-list {
        font-size: 0.85rem;
        gap: 5px;
    }

    .breadcrumb-link,
    .breadcrumbs a {
        padding: 3px 6px;
    }

    /* Hide text on mobile, keep icons */
    .breadcrumb-text {
        display: none;
    }

    .breadcrumb-item:first-child .breadcrumb-text,
    .breadcrumb-item:last-child .breadcrumb-text {
        display: inline;
    }
}

@media (max-width: 480px) {
    .breadcrumb-wrapper,
    .breadcrumbs-wrapper {
        border-radius: 8px;
        padding: 8px 12px;
    }

    .breadcrumbs,
    .breadcrumb-inner {
        font-size: 0.8rem;
    }
}

/* ==========================================================================
   Animation
   ========================================================================== */

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

.breadcrumb-wrapper,
.breadcrumbs-wrapper {
    animation: fadeIn 0.3s ease;
}