/**
 * TROID Phase 2: /paieska search results page styles
 * Status: stable
 * Originated: 2024-12 TROID Phase 2
 */

/* ========== PAGE LAYOUT ========== */

.paieska-header {
    padding: 0 0 1rem 0;
    background: transparent;
    border-bottom: 1px solid #dee2e6;
}

.paieska-header h1 {
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.paieska-header p {
    margin-bottom: 0;
}

/* ========== STATUS & INFO ========== */

.paieska-status {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 0.375rem;
    border-left: 3px solid #0c59a2;
}

.paieska-info {
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 0.375rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.paieska-info .badge {
    font-weight: 500;
    font-size: 0.8rem;
}

/* Mobile: center the row with type badge and results counter */
@media (max-width: 576px) {
    .paieska-info > .d-flex {
        justify-content: center;
        text-align: center;
        width: 100%;
    }

    .paieska-info #paieska-count {
        margin-left: 0 !important; /* Override ms-auto */
    }
}

/* ========== ACTIVE FILTERS ========== */

.paieska-filters {
    padding: 0.5rem 0;
}

.paieska-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: #e9ecef;
    border-radius: 1rem;
    font-size: 0.875rem;
    color: #495057;
}

.paieska-filter-tag .filter-label {
    font-weight: 500;
    color: #6c757d;
}

.paieska-filter-tag .filter-value {
    color: #212529;
}

/* ========== RESULTS CONTAINER ========== */

.paieska-results {
    margin-bottom: 2rem;
}

/* ========== COMPANY CARDS (styled like in companies_grid.html) ========== */

.card.list-companies {
    width: calc(100% / 4 - 1rem);
    margin-bottom: 1rem;
    margin-left: 0.5rem;
    margin-right: 0.5rem;
    box-shadow: 0 0 5px #ccc;
    border-radius: 6px;
    overflow: hidden;
}

.card.list-companies a {
    color: #0c59a2;
    text-decoration: none;
}

.card.list-companies .card-body {
    font-size: 12px;
    line-height: normal;
    background-color: rgba(255, 255, 255, 0.9) !important;
    color: #212529;
}

.card.list-companies .default-logo {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.card.list-companies .default-logo img {
    max-width: 80%;
    margin: 0 auto;
    max-height: 100%;
}

.default-logo {
    background: #0c5ca7;
    padding: 1rem;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    color: white;
    font-weight: bold;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 0 !important;
}

.default-logo span {
    font-size: small;
    text-align: center !important;
    color: white !important;
}

.mb16 {
    margin-bottom: 1rem;
}

@media (max-width: 992px) {
    .card.list-companies {
        width: calc(100% / 3 - 1rem);
    }
}

@media (max-width: 768px) {
    .card.list-companies {
        width: calc(100% / 2 - 1rem);
    }
}

@media (max-width: 576px) {
    .card.list-companies {
        width: 100%;
    }
}

/* ========== ARTICLE CARDS (styled like in blog_posts.html) ========== */

.card.list-articles {
    width: calc(100% / 3 - 1rem);
    margin-bottom: 1rem;
    margin-left: 0.5rem;
    margin-right: 0.5rem;
    box-shadow: 0 0 5px #ccc;
    border-radius: 6px;
    overflow: hidden;
}

.card.list-articles a {
    color: #0c59a2;
    text-decoration: none;
}

.card.list-articles .card-body {
    padding: 1rem;
}

.card.list-articles .card-title {
    font-size: 1rem;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.card.list-articles .card-text {
    font-size: 0.875rem;
    color: #6c757d;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card.list-articles .card-footer {
    background: transparent;
    border-top: 1px solid #eee;
    padding: 0.5rem 1rem;
}

.card.list-articles .ratio-hp {
    height: 180px;
    overflow: hidden;
}

.card.list-articles .cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-cover-placeholder {
    width: 100%;
    height: 100%;
    background-color: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #adb5bd;
}

@media (max-width: 992px) {
    .card.list-articles {
        width: calc(100% / 2 - 1rem);
    }
}

@media (max-width: 576px) {
    .card.list-articles {
        width: 100%;
    }
}

/* ========== COMPANY CARD (styled like in category.html) ========== */

.paieska-company-card {
    display: block;
    padding: 1.5rem 0;
    border-bottom: 1px solid #dee2e6;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s ease;
}

.paieska-company-card:first-child {
    padding-top: 0;
}

.paieska-company-card:hover {
    background-color: #f8f9fa;
    text-decoration: none;
    color: inherit;
}

.paieska-company-row {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.paieska-company-logo-col {
    flex: 0 0 100px;
}

.paieska-company-logo {
    width: 100px;
    height: 80px;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    background-color: #f8f9fa;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.paieska-company-logo-placeholder {
    width: 100px;
    height: 80px;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #adb5bd;
}

.paieska-company-main {
    flex: 1;
    min-width: 0;
}

.paieska-company-name {
    font-weight: 600;
    color: #0c59a2;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.paieska-company-name:hover {
    text-decoration: underline;
}

.paieska-company-address {
    font-size: 0.9rem;
    color: #495057;
    margin-bottom: 0.25rem;
}

.paieska-company-address strong {
    color: #212529;
}

.paieska-company-code {
    font-size: 0.875rem;
    color: #6c757d;
}

.paieska-company-code strong {
    color: #495057;
}

@media (max-width: 767px) {
    .paieska-company-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .paieska-company-logo-col {
        flex: none;
    }
    
    .paieska-company-logo,
    .paieska-company-logo-placeholder {
        width: 80px;
        height: 60px;
    }
}

/* ========== ARTICLE CARD (styled like in straipsniai.html) ========== */

.paieska-article-card {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.paieska-article-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
    text-decoration: none;
    color: inherit;
}

.paieska-article-image {
    width: 100%;
    height: 180px;
    background-color: #f8f9fa;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.paieska-article-image-placeholder {
    width: 100%;
    height: 180px;
    background-color: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #adb5bd;
}

.paieska-article-body {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.paieska-article-title {
    font-weight: 600;
    color: #212529;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.paieska-article-summary {
    font-size: 0.875rem;
    color: #6c757d;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.paieska-article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    font-size: 0.8rem;
}

.paieska-article-date {
    color: #6c757d;
    font-weight: 500;
}

.paieska-article-category {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: #0c59a2;
    font-size: 0.8rem;
}

.paieska-article-category i {
    color: #6c757d;
}

/* ========== PAGINATION ========== */

.paieska-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.paieska-pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background: white;
    color: #495057;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.paieska-pagination-btn:hover {
    background: #f8f9fa;
    border-color: #0c59a2;
    color: #0c59a2;
    text-decoration: none;
}

.paieska-pagination-btn.active {
    background: #0c59a2;
    border-color: #0c59a2;
    color: white;
}

.paieska-pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.paieska-pagination-info {
    font-size: 0.875rem;
    color: #6c757d;
    margin-left: 0.5rem;
}

/* ========== EMPTY STATE ========== */

.paieska-empty {
    text-align: center;
    padding: 4rem 2rem;
    background: transparent;
    grid-column: 1 / -1; /* Spans full grid width */
}

.paieska-empty-icon {
    font-size: 4rem;
    color: #dee2e6;
    margin-bottom: 1rem;
}

.paieska-empty-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

.paieska-empty-text {
    color: #6c757d;
    margin-bottom: 0;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* ========== CALL TO ACTION (no query) ========== */

.paieska-cta {
    text-align: center;
    padding: 4rem 2rem;
    background: transparent;
    grid-column: 1 / -1; /* Takes full grid width */
}

.paieska-cta-icon {
    font-size: 4rem;
    color: #0c59a2;
    margin-bottom: 1.5rem;
}

.paieska-cta-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.75rem;
}

.paieska-cta-text {
    font-size: 1.1rem;
    color: #6c757d;
    max-width: 500px;
    margin: 0 auto;
}

/* ========== LOADING SKELETON ========== */

.paieska-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 0.375rem;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.paieska-skeleton-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 1rem;
}

.paieska-skeleton-logo {
    width: 60px;
    height: 60px;
}

.paieska-skeleton-title {
    height: 1.25rem;
    width: 70%;
    margin-bottom: 0.5rem;
}

.paieska-skeleton-text {
    height: 0.875rem;
    width: 50%;
}
