/**
 * BL News CMS - Dictionary Styles
 * Zintegrowane z głównym CSS strony
 * Wersja 1.4.0 (z stronicowaniem i mobile responsive)
 */

/* ===== SŁOWNIK - UŻYWA ZMIENNYCH Z GŁÓWNEGO CSS ===== */

/* Hero Section */
.hero-section {
    background: 
        linear-gradient(135deg, #1C8CD3 0%, rgba(48, 169, 229, 0.8) 100%),
        url('/slownik/tlo_slownik.webp');
    background-size: cover;
    background-position: center;
    border-radius: 16px;
    padding: 40px 30px;
    margin-bottom: 30px;
    margin-top: -20px;
    position: relative;
}

.hero-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: #ffffff;
    position: relative;
    z-index: 1;
}

.hero-section p {
    font-size: 1.1rem;
    color: #ffffff;
    margin-bottom: 25px;
    opacity: 0.95;
    position: relative;
    z-index: 1;
}

/* Search Box */
.search-box {
    position: relative;
    max-width: 600px;
    z-index: 1;
}

.hero-section .badge {
    position: relative;
    z-index: 1;
}

.search-box input {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 12px 80px 12px 20px;
    border-radius: 10px;
    font-size: 1rem;
    width: 100%;
}

.search-box input::placeholder {
    color: var(--text-light);
}

.search-box input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.2rem rgba(46, 170, 230, 0.1);
    outline: none;
}

.search-box .search-clear {
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 1rem;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: color 0.2s ease;
}

.search-box .search-clear:hover {
    color: var(--accent-color);
}

.search-box button {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--accent-color);
    font-size: 1.2rem;
    cursor: pointer;
}

/* Filter Section - przezroczyste tło */
.filter-section {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
}

body.dark-mode .hero-section {
    background: 
        linear-gradient(135deg, #023e8a 0%, rgba(0, 119, 182, 0.9) 100%),
        url('/slownik/tlo_slownik.webp');
    background-size: cover;
    background-position: center;
}

body.dark-mode .hero-section h1,
body.dark-mode .hero-section p {
    color: #caf0f8;
}

body.dark-mode .filter-section {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}

.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.category-btn {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 5px 14px;
    border-radius: 18px;
    font-size: 0.75rem;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.category-btn:hover {
    background: rgba(46, 170, 230, 0.1);
    border-color: var(--accent-color);
}

.category-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

body.dark-mode .category-btn:not(.active) {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #b0b8c0;
}

body.dark-mode .category-btn:not(.active):hover {
    background: rgba(46, 170, 230, 0.15);
    border-color: rgba(46, 170, 230, 0.4);
    color: #d0d8e0;
}

/* Alphabet Navigation */
.alphabet-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.alphabet-btn {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
}

.alphabet-btn:hover {
    background: rgba(46, 170, 230, 0.1);
    border-color: var(--accent-color);
}

.alphabet-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

body.dark-mode .alphabet-btn:not(.active) {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #b0b8c0;
}

body.dark-mode .alphabet-btn:not(.active):hover {
    background: rgba(46, 170, 230, 0.15);
    border-color: rgba(46, 170, 230, 0.4);
    color: #d0d8e0;
}

/* Results Header */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.results-count {
    font-size: 0.95rem;
    color: var(--text-light);
    flex: 1;
}

.results-count span {
    color: var(--accent-color);
    font-weight: 700;
    font-size: 1.15rem;
}

.sort-dropdown {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 6px 32px 6px 12px;
    border-radius: 6px;
    font-size: 0.82rem;
    width: auto;
    min-width: 150px;
    max-width: 180px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23168aad' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    cursor: pointer;
}

body.dark-mode .sort-dropdown {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%232EAAE6' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
}

.sort-dropdown:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.2rem rgba(46, 170, 230, 0.1);
    outline: none;
}

.sort-dropdown option {
    background: var(--bg-white);
    color: var(--text-color);
}

/* Term Cards - 3 kolumny, przezroczyste tło */
.terms-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.term-card {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 18px;
    transition: all 0.25s ease;
    cursor: pointer;
}

.term-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(46, 170, 230, 0.12);
}

body.dark-mode .term-card {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .term-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--accent-color);
}

.term-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

/* Ikony kategorii - Bootstrap Icons */
.term-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: #95a5a6;
    flex-shrink: 0;
    transition: color 0.25s ease;
}

.term-card:hover .term-icon {
    color: var(--accent-color);
}

body.dark-mode .term-icon {
    color: #6c7580;
}

body.dark-mode .term-card:hover .term-icon {
    color: var(--accent-color);
}

.term-content {
    flex: 1;
    min-width: 0;
}

.term-category {
    display: inline-block;
    background: rgba(46, 170, 230, 0.08);
    color: var(--accent-color);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
}

.term-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 4px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.term-alias {
    color: var(--text-light);
    font-size: 0.78rem;
    margin-bottom: 8px;
    font-style: italic;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.term-definition {
    color: var(--text-light);
    line-height: 1.5;
    font-size: 0.82rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

body.dark-mode .term-definition {
    color: #b0b8c0;
}

/* Modal Styles */
.modal-content {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 14px;
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 20px 24px;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 16px 24px;
}

.modal-title {
    color: var(--text-color);
    font-size: 1.3rem;
}

body.dark-mode .modal-content {
    background: rgba(26, 29, 46, 0.95);
    border-color: rgba(255, 255, 255, 0.1);
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-share, .btn-copy {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 8px 15px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.88rem;
}

.btn-share:hover, .btn-copy:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
}

body.dark-mode .btn-share,
body.dark-mode .btn-copy {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e9ecef;
}

.share-options {
    display: none;
    gap: 10px;
    margin-top: 12px;
    padding: 12px;
    background: var(--bg-light);
    border-radius: 8px;
}

.share-options.show {
    display: flex;
}

body.dark-mode .share-options {
    background: rgba(255, 255, 255, 0.03);
}

.share-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    color: #fff;
    font-size: 1rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.share-btn.facebook { background: #1877f2; }
.share-btn.twitter { background: #000; }
.share-btn.linkedin { background: #0a66c2; }
.share-btn.email { background: #ea4335; }

.btn-read-more {
    background: var(--accent-color);
    border: none;
    color: #fff;
    padding: 10px 22px;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.92rem;
}

.btn-read-more:hover {
    background: #1578b8;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(46, 170, 230, 0.25);
    color: #fff;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 50px 20px;
    grid-column: 1 / -1;
}

.no-results i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.2;
    color: var(--text-light);
}

.no-results h3 {
    color: var(--text-color);
    margin-bottom: 8px;
}

.no-results p {
    color: var(--text-light);
}

/* ===== STRONICOWANIE ===== */
.pagination-container {
    margin-top: 40px;
    padding: 25px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: center;
}

.page-item {
    display: inline-block;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.page-link:hover {
    background: rgba(46, 170, 230, 0.1);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.page-item.active .page-link {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
    cursor: default;
}

.page-item.disabled .page-link {
    background: rgba(255, 255, 255, 0.3);
    border-color: var(--border-color);
    color: var(--text-light);
    cursor: not-allowed;
    opacity: 0.5;
}

body.dark-mode .page-link {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #b0b8c0;
}

body.dark-mode .page-link:hover {
    background: rgba(46, 170, 230, 0.15);
    border-color: rgba(46, 170, 230, 0.4);
    color: #d0d8e0;
}

body.dark-mode .page-item.active .page-link {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

body.dark-mode .page-item.disabled .page-link {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.05);
    color: #6c7580;
}

.pagination-info {
    color: var(--text-light);
    font-size: 0.88rem;
    text-align: center;
}

body.dark-mode .pagination-info {
    color: #b0b8c0;
}

/* Responsive - tablet */
@media (max-width: 992px) {
    .terms-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .term-detail-container {
        grid-template-columns: 1fr;
    }
    
    .term-sidebar {
        position: static;
    }
}

/* Responsive - mobile */
@media (max-width: 768px) {
    .terms-list {
        grid-template-columns: 1fr;
    }
    
    .hero-section {
        padding: 30px 20px;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .alphabet-nav {
        gap: 4px;
    }
    
    .alphabet-btn {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }
    
    /* Stronicowanie mobile */
    .pagination-container {
        margin-top: 30px;
        padding: 20px 0;
    }
    
    .pagination {
        gap: 4px;
    }
    
    .page-link {
        min-width: 34px;
        height: 34px;
        padding: 0 8px;
        font-size: 0.85rem;
    }
    
    .pagination-info {
        font-size: 0.82rem;
    }
}

@media (max-width: 480px) {
    .page-link {
        min-width: 30px;
        height: 30px;
        padding: 0 6px;
        font-size: 0.8rem;
    }
}


/* ===== STRONA SZCZEGÓŁOWA HASŁA (TERM DETAIL) ===== */

.term-page-container {
    padding: 30px 0;
    max-width: 1200px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-color);
    text-decoration: none;
    font-size: 0.95rem;
    margin-top: 10px;
    margin-bottom: 0px;
    transition: all 0.2s ease;
}

.back-link:hover {
    color: #1578b8;
    gap: 12px;
}

.term-detail-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 40px;
    margin-top: 20px;
}

.term-main-content {
    min-width: 0;
}

.term-header-section {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 25px;
}

body.dark-mode .term-header-section {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.term-header-top {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.term-icon-large {
    width: 60px;
    height: 60px;
    background: rgba(46, 170, 230, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--accent-color);
    flex-shrink: 0;
}

body.dark-mode .term-icon-large {
    background: rgba(46, 170, 230, 0.15);
}

.term-category-badge {
    background: rgba(46, 170, 230, 0.1);
    color: var(--accent-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

body.dark-mode .term-category-badge {
    background: rgba(46, 170, 230, 0.2);
}

.term-main-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 10px;
    line-height: 1.2;
}

.term-alias-text {
    color: var(--text-light);
    font-size: 1.1rem;
    font-style: italic;
    margin-bottom: 25px;
}

.definition-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 25px 0 15px 0;
    padding-top: 25px;
    border-top: 2px solid var(--border-color);
}

.definition-content {
    color: var(--text-color);
    font-size: 1.05rem;
    line-height: 1.8;
}

.definition-content p {
    margin-bottom: 15px;
}

body.dark-mode .definition-content {
    color: #d0d8e0;
}

.pro-tips-section {
    background: rgba(46, 170, 230, 0.05);
    border-left: 4px solid var(--accent-color);
    border-radius: 8px;
    padding: 20px;
    margin-top: 25px;
}

body.dark-mode .pro-tips-section {
    background: rgba(46, 170, 230, 0.1);
}

.pro-tips-section h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    color: var(--accent-color);
    margin-bottom: 12px;
}

.pro-tips-section .content {
    color: var(--text-color);
    line-height: 1.7;
}

/* Sekcja udostępniania */
.share-section {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    margin-top: 25px;
}

body.dark-mode .share-section {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}

.share-section h3 {
    font-size: 1.2rem;
    color: var(--text-color);
    margin-bottom: 15px;
}

.share-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.social-share-buttons {
    display: none;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.social-share-buttons.show {
    display: flex;
}

.social-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.social-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.social-btn.facebook { background: #1877f2; }
.social-btn.twitter { background: #000; }
.social-btn.linkedin { background: #0a66c2; }
.social-btn.email { background: #ea4335; }

/* Sidebar z powiązanymi hasłami */
.term-sidebar {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.term-sidebar h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 20px;
}

.related-terms-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.related-term-item {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 15px;
    text-decoration: none;
    transition: all 0.25s ease;
    display: block;
}

.related-term-item:hover {
    border-color: var(--accent-color);
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(46, 170, 230, 0.1);
}

body.dark-mode .related-term-item {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .related-term-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.related-term-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.related-term-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #95a5a6;
    flex-shrink: 0;
}

.related-term-item:hover .related-term-icon {
    color: var(--accent-color);
}

.related-term-category {
    background: rgba(46, 170, 230, 0.08);
    color: var(--accent-color);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.related-term-content h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 6px;
    line-height: 1.3;
}

.related-term-desc {
    color: var(--text-light);
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0;
}

body.dark-mode .related-term-desc {
    color: #b0b8c0;
}

.no-related {
    color: var(--text-light);
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Responsive dla strony szczegółowej */
@media (max-width: 992px) {
    .term-detail-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .term-sidebar {
        position: static;
    }
    
    .term-main-title {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .term-header-section {
        padding: 20px;
    }
    
    .term-main-title {
        font-size: 1.75rem;
    }
    
    .term-icon-large {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .definition-content {
        font-size: 1rem;
    }
}