/**
 * Topical Bible Audit - Styles
 * Version: 1.0.0
 */

.topical-audit {
    font-family: var(--tba-font-family, Arial, sans-serif);
    font-size: var(--tba-font-size, 16px);
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
}

.topical-audit h2 {
    color: #333;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* Navigation Bar - Using higher specificity instead of !important */
body .topical-audit .topical-nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    flex-wrap: nowrap;
    gap: 15px;
}

body .topical-audit .topical-nav-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

body .topical-audit .letter-dropdown {
    padding: 8px 12px;
    font-size: 16px;
    font-weight: 600;
    border: 2px solid #667eea;
    border-radius: 6px;
    background: white;
    color: #333;
    cursor: pointer;
    min-width: 60px;
    transition: all 0.3s;
}

body .topical-audit .letter-dropdown:hover {
    background: #667eea;
    color: white;
}

body .topical-audit .letter-dropdown:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

body .topical-audit .topic-count {
    font-size: 13px;
    color: #666;
    font-weight: 500;
    padding: 4px 10px;
    background: #e9ecef;
    border-radius: 12px;
    white-space: nowrap;
}

/* Search Container */
body .topical-audit .topical-search-container {
    position: relative;
    width: 300px;
    flex-shrink: 0;
}

body .topical-audit .topical-search-input {
    width: 100%;
    padding: 8px 36px 8px 12px;
    font-size: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    transition: all 0.3s;
    box-sizing: border-box;
}

body .topical-audit .topical-search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

body .topical-audit .search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    max-width: 16px;
    max-height: 16px;
    stroke: #d4af37;
    fill: none;
    pointer-events: none;
    stroke-width: 2.5;
}

body .topical-audit .search-clear {
    position: absolute;
    right: 35px;
    top: 50%;
    transform: translateY(-50%);
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s;
}

body .topical-audit .search-clear:hover {
    background: #c82333;
    transform: translateY(-50%) scale(1.1);
}

body .topical-audit .search-info {
    padding: 10px 15px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    margin-bottom: 15px;
    color: #155724;
}

body .topical-audit .clear-search-link {
    margin-left: 10px;
    color: #155724;
    text-decoration: underline;
    font-weight: 600;
}

body .topical-audit .clear-search-link:hover {
    color: #0c3d1a;
}

.topical-audit .topic-item {
    margin-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
}

body .topical-audit .topic-title {
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    padding: 8px 0;
    color: #333;
    transition: color 0.3s;
}

body .topical-audit .topic-title:hover {
    color: #667eea;
}

body .topical-audit .topic-title .toggle {
    display: inline-block;
    margin-right: 8px;
    transition: transform 0.3s;
    color: var(--tba-arrow-color, #667eea);
}

body .topical-audit .topic-title.active .toggle {
    transform: rotate(90deg);
}

.topical-audit .topic-def {
    font-weight: normal;
    color: #666;
    font-style: italic;
    margin-left: 8px;
    font-size: 14px;
}

body .topical-audit .topic-body {
    display: none;
    margin-left: 24px;
    margin-top: 10px;
}

/* Ensure jQuery slideToggle can override display */
.topical-audit .topic-body[style*="display: block"] {
    display: block !important;
}

.topical-audit .no-content {
    color: #999;
    font-style: italic;
    margin: 8px 0;
}

.topical-audit .section-title {
    font-weight: 700;
    font-style: italic;
    margin: 12px 0 8px;
    color: #444;
}

.topical-audit ul {
    margin: 4px 0 14px 14px;
    padding-left: 14px;
    list-style-type: disc;
}

.topical-audit li {
    margin: 6px 0;
    line-height: 1.6;
}

.topical-audit .ref {
    color: #1a73e8;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.3s;
}

.topical-audit .ref:hover {
    color: #0d47a1;
}

.topical-audit .ref-simple {
    color: #1a73e8;
    text-decoration: none;
}

.topical-audit .ref-sep {
    display: inline-block;
    font-size: 2.2em;
    font-weight: bold;
    line-height: 0;
    vertical-align: middle;
    margin: 0 6px;
    color: #444;
    transform: translateY(-0.05em);
}

.topical-audit .popover {
    position: absolute;
    display: none;
    max-width: 420px;
    background: #fff;
    border: 1px solid #ccc;
    padding: 12px 15px;
    font-size: 13px;
    line-height: 1.5;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    border-radius: 4px;
}

.topical-audit .popover strong {
    color: #667eea;
    margin-right: 4px;
}

.topical-audit .pagination {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
    text-align: center;
}

.topical-audit .pagination a {
    display: inline-block;
    padding: 8px 16px;
    margin: 0 5px;
    background: #667eea;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s;
}

.topical-audit .pagination a:hover {
    background: #5568d3;
}

.topical-audit .pagination .page-info {
    display: inline-block;
    margin: 0 15px;
    color: #666;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .topical-audit {
        padding: 10px;
    }

    .topical-audit .topic-title {
        font-size: 14px;
    }

    .topical-audit .topic-def {
        display: block;
        margin-left: 24px;
        margin-top: 4px;
    }

    .topical-audit .popover {
        max-width: 90vw;
    }

    body .topical-audit .topical-nav-bar {
        flex-direction: column;
        align-items: stretch;
    }

    body .topical-audit .topical-nav-left {
        flex-direction: column;
        align-items: stretch;
    }

    body .topical-audit .letter-dropdown {
        width: 100%;
    }

    body .topical-audit .topical-search-container {
        width: 100%;
    }

    body .topical-audit .topic-count {
        text-align: center;
    }
}

/* Standalone Version Styles (No Popover) */
.topical-audit-standalone {
    font-family: var(--tba-font-family, Arial, sans-serif);
    font-size: var(--tba-font-size, 16px);
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
}

.topical-audit-standalone h2 {
    color: #333;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.topical-audit-standalone .topic-item-standalone {
    margin-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
}

.topical-audit-standalone .topic-title-standalone {
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    padding: 8px 0;
    color: #333;
    transition: color 0.3s;
}

.topical-audit-standalone .topic-title-standalone:hover {
    color: #667eea;
}

.topical-audit-standalone .topic-title-standalone .toggle-standalone {
    display: inline-block;
    margin-right: 8px;
    transition: transform 0.3s;
    color: var(--tba-arrow-color, #667eea);
}

.topical-audit-standalone .topic-title-standalone.active .toggle-standalone {
    transform: rotate(90deg);
}

.topical-audit-standalone .topic-def-standalone {
    font-weight: normal;
    color: #666;
    font-style: italic;
    margin-left: 8px;
    font-size: 14px;
}

body .topical-audit-standalone .topic-body-standalone {
    display: none;
    margin-left: 24px;
    margin-top: 10px;
}

/* Ensure jQuery slideToggle can override display */
.topical-audit-standalone .topic-body-standalone[style*="display: block"] {
    display: block !important;
}

.topical-audit-standalone .no-content-standalone {
    color: #999;
    font-style: italic;
    margin: 8px 0;
}

.topical-audit-standalone .section-title-standalone {
    font-weight: 700;
    font-style: italic;
    margin: 12px 0 8px;
    color: #444;
}

.topical-audit-standalone .ref-list-standalone {
    margin: 4px 0 14px 14px;
    padding-left: 14px;
    list-style-type: disc;
}

.topical-audit-standalone .ref-list-standalone li {
    margin: 6px 0;
    line-height: 1.6;
}

.topical-audit-standalone .ref-text-only {
    color: #1a73e8;
    font-weight: normal;
}

.topical-audit-standalone .ref-sep-standalone {
    display: inline-block;
    font-size: 2.2em;
    font-weight: bold;
    line-height: 0;
    vertical-align: middle;
    margin: 0 6px;
    color: #444;
    transform: translateY(-0.05em);
}

.topical-audit-standalone .pagination-standalone {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
    text-align: center;
}

.topical-audit-standalone .pagination-standalone a {
    display: inline-block;
    padding: 8px 16px;
    margin: 0 5px;
    background: #667eea;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s;
}

.topical-audit-standalone .pagination-standalone a:hover {
    background: #5568d3;
}

.topical-audit-standalone .pagination-standalone .page-info-standalone {
    display: inline-block;
    margin: 0 15px;
    color: #666;
    font-size: 14px;
}

/* Responsive for Standalone */
@media (max-width: 768px) {
    .topical-audit-standalone {
        padding: 10px;
    }

    .topical-audit-standalone .topic-title-standalone {
        font-size: 14px;
    }

    .topical-audit-standalone .topic-def-standalone {
        display: block;
        margin-left: 24px;
        margin-top: 4px;
    }
}