/**
 * Topics Page - Tópicos do Direito
 * Página customizada para listagem de tópicos jurídicos
 */

:root {
    --primary-green: #203a24;
    --primary-green-light: #2d5234;
    --secondary-green: #4a8f4d;
    --light-green: #e8f5e9;
    --hover-green: #f1f8f1;
}

.navbar-main {
    margin-top: 60px;
}

/* BREADCRUMB */
.breadcrumb-custom {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

/* PAGE HEADER */
.topics-page-header {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-light) 100%);
    color: white;
    padding: 3.5rem 0 3rem;
    margin-bottom: 3rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.topics-page-header h1 {
    font-size: 2.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.topics-subtitle {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

/* SEARCH BOX */
.topics-search-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.topics-search-wrapper {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.topics-search-wrapper input {
    width: 100%;
    padding: 16px 50px 16px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
}

.topics-search-wrapper input:focus {
    outline: none;
    border-color: var(--secondary-green);
    box-shadow: 0 0 0 3px rgba(74, 143, 77, 0.1);
}

.topics-search-wrapper > i {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
    color: #999;
}

.search-loading {
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

.topics-search-stats {
    text-align: center;
    margin-top: 15px;
    color: #666;
    font-size: 0.9375rem;
}

main.container-custom {
    max-width: 1320px;
    margin: 0 auto;
}

/* ALPHABET INDEX */
.topics-alphabet-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.topics-alphabet-index {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.topics-alphabet-letter {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    color: var(--primary-green);
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
}

.topics-alphabet-letter:hover,
.topics-alphabet-letter.active {
    background: var(--secondary-green);
    color: white;
    border-color: var(--secondary-green);
    transform: translateY(-2px);
}

.topics-alphabet-all {
    min-width: 60px;
    padding: 0 12px;
}

/* TOPICS LIST */
.topics-list-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 40px;
}

.topics-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--light-green);
}

.topics-section-title {
    font-size: 1.5rem;
    color: var(--primary-green);
    font-weight: 700;
    margin: 0;
}

.topics-visible-count {
    color: #666;
    font-size: 0.9375rem;
}

/* LOADING STATE */
.topics-loading {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.topics-loading i {
    font-size: 3rem;
    margin-bottom: 20px;
    display: block;
    animation: spin 1s linear infinite;
}

.topics-loading p {
    font-size: 1rem;
    margin: 0;
}

/* COLUMN LAYOUT */
.topics-columns {
    column-count: 4;
    column-gap: 30px;
}

.topics-letter-group {
    break-inside: avoid;
    margin-bottom: 30px;
}

.topics-letter-header {
    background: var(--light-green);
    color: var(--primary-green);
    padding: 8px 15px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 1.125rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.topics-letter-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.topics-item {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.topics-item:last-child {
    border-bottom: none;
}

.topics-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s;
}

.topics-link:hover {
    background: var(--hover-green);
    color: var(--primary-green);
    padding-left: 15px;
}

.topics-item-name {
    font-size: 0.9375rem;
    font-weight: 500;
}

.topics-item-count {
    font-size: 0.75rem;
    color: #999;
    background: #f5f5f5;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

.topics-link:hover .topics-item-count {
    background: var(--light-green);
    color: var(--secondary-green);
}

/* NO RESULTS */
.topics-no-results {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.topics-no-results i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 20px;
    display: block;
}

.topics-no-results h3 {
    color: var(--primary-green);
    margin-bottom: 10px;
}

.topics-no-results p {
    margin: 0;
}

/* MOBILE RESPONSIVE */
@media (max-width: 1200px) {
    .topics-columns {
        column-count: 3;
    }
}

@media (max-width: 968px) {
    .topics-columns {
        column-count: 2;
    }

    .topics-alphabet-letter {
        width: 38px;
        height: 38px;
        font-size: 0.875rem;
    }

    .topics-page-header h1 {
        font-size: 1.75rem;
    }
}

@media (max-width: 640px) {
    .topics-columns {
        column-count: 1;
    }

    .topics-page-header h1 {
        font-size: 1.5rem;
    }

    .topics-alphabet-index {
        gap: 5px;
    }

    .topics-alphabet-letter {
        width: 35px;
        height: 35px;
    }

    .topics-list-section {
        padding: 20px;
    }

    .topics-search-section {
        padding: 20px;
    }
}
