<?php
/**
 * Public CSS for the Tabeebo Medical News plugin
 *
 * This file contains the CSS styles for the public-facing functionality
 * of the plugin, including search form and results display.
 *
 * @link       https://tabeebo.com
 * @since      1.0.0
 */

/* Container */
.tmn-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Search Form */
.tmn-search-form {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tmn-search-input-group {
    display: flex;
    margin-bottom: 15px;
}

.tmn-search-input {
    flex: 1;
    padding: 12px 15px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    outline: none;
    transition: border-color 0.3s;
}

.tmn-search-input:focus {
    border-color: #2271b1;
}

.tmn-search-button {
    padding: 12px 20px;
    font-size: 16px;
    background-color: #2271b1;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background-color 0.3s;
}

.tmn-search-button:hover {
    background-color: #135e96;
}

/* Filter Toggle */
.tmn-filter-toggle-container {
    text-align: center;
    margin-bottom: 15px;
}

.tmn-filter-toggle {
    display: inline-flex;
    align-items: center;
    color: #2271b1;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.tmn-filter-toggle:hover {
    text-decoration: underline;
}

.tmn-filter-toggle-icon {
    margin-left: 5px;
    font-weight: bold;
}

.tmn-filter-toggle.active .tmn-filter-toggle-icon {
    transform: rotate(45deg);
}

/* Filters */
.tmn-filters {
    padding: 15px;
    background-color: #f0f0f1;
    border-radius: 4px;
    margin-bottom: 15px;
}

.tmn-filter-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px 15px;
}

.tmn-filter-group {
    flex: 1;
    min-width: 200px;
    padding: 0 10px;
    margin-bottom: 15px;
}

.tmn-filter-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #23282d;
}

.tmn-checkbox-group {
    display: flex;
    flex-wrap: wrap;
}

.tmn-checkbox-group label {
    margin-right: 15px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
}

.tmn-checkbox-group input[type="checkbox"] {
    margin-right: 5px;
}

.tmn-date-range {
    display: flex;
    flex-direction: column;
}

.tmn-date-range-select {
    margin-bottom: 10px;
}

.tmn-date-inputs {
    display: flex;
    gap: 10px;
}

.tmn-date-from-group,
.tmn-date-to-group {
    flex: 1;
}

.tmn-date-inputs label {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    color: #646970;
}

.tmn-date-inputs input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Search Results */
.tmn-search-results {
    margin-top: 30px;
}

.tmn-search-results-container {
    padding: 20px 0;
}

.tmn-results-header {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.tmn-results-title {
    font-size: 20px;
    font-weight: 600;
    color: #23282d;
    margin: 0;
}

/* Articles Grid */
.tmn-articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.tmn-article-card {
    display: flex;
    flex-direction: column;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.tmn-article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.tmn-article-source {
    padding: 10px;
    background-color: #f9f9f9;
    border-bottom: 1px solid #eee;
}

.tmn-source-badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 4px;
    color: white;
}

.tmn-source-pubmed {
    background-color: #2271b1;
}

.tmn-source-europepmc {
    background-color: #3c8c3c;
}

.tmn-article-thumbnail {
    height: 180px;
    overflow: hidden;
}

.tmn-article-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tmn-article-content {
    flex: 1;
    padding: 15px;
    display: flex;
    flex-direction: column;
}

.tmn-article-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 10px;
    line-height: 1.3;
}

.tmn-article-title a {
    color: #23282d;
    text-decoration: none;
}

.tmn-article-title a:hover {
    color: #2271b1;
}

.tmn-article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #646970;
}

.tmn-article-date::before {
    content: "\f508";
    font-family: dashicons;
    margin-right: 3px;
    vertical-align: middle;
}

.tmn-article-journal::before {
    content: "\f330";
    font-family: dashicons;
    margin-right: 3px;
    vertical-align: middle;
}

.tmn-article-abstract {
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.5;
    color: #50575e;
    flex: 1;
}

.tmn-article-authors {
    margin-bottom: 15px;
    font-size: 13px;
    color: #646970;
}

.tmn-article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.tmn-article-read-more {
    display: inline-block;
    padding: 8px 12px;
    background-color: #f0f0f1;
    color: #2271b1;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    transition: background-color 0.2s;
}

.tmn-article-read-more:hover {
    background-color: #e5e5e5;
    color: #135e96;
}

.tmn-save-article {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    background-color: transparent;
    color: #2271b1;
    border: 1px solid #2271b1;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.tmn-save-article:hover {
    background-color: #f0f7fb;
}

.tmn-save-article.tmn-loading {
    opacity: 0.7;
    cursor: wait;
}

.tmn-save-article.tmn-saved {
    background-color: #edfaef;
    color: #3c8c3c;
    border-color: #3c8c3c;
}

.tmn-save-article .dashicons {
    margin-right: 3px;
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Pagination */
.tmn-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 30px;
}

.tmn-page-link,
.tmn-page-current,
.tmn-page-dots {
    display: inline-block;
    padding: 8px 12px;
    min-width: 36px;
    text-align: center;
    border-radius: 4px;
    font-size: 14px;
}

.tmn-page-link {
    background-color: #f0f0f1;
    color: #2271b1;
    text-decoration: none;
    transition: background-color 0.2s;
}

.tmn-page-link:hover {
    background-color: #e5e5e5;
}

.tmn-page-current {
    background-color: #2271b1;
    color: white;
    font-weight: 500;
}

/* Loading and Error States */
.tmn-loading,
.tmn-error,
.tmn-no-results {
    padding: 30px;
    text-align: center;
    background-color: #f9f9f9;
    border-radius: 8px;
    color: #646970;
}

.tmn-loading::before {
    content: "\f463";
    font-family: dashicons;
    display: block;
    font-size: 30px;
    margin-bottom: 10px;
    animation: tmn-spin 2s infinite linear;
}

.tmn-error {
    color: #d63638;
}

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

/* Access Denied */
.tmn-access-denied {
    padding: 30px;
    text-align: center;
    background-color: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 30px;
}

.tmn-button {
    display: inline-block;
    padding: 10px 15px;
    background-color: #2271b1;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.2s;
}

.tmn-button:hover {
    background-color: #135e96;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .tmn-articles-grid {
        grid-template-columns: 1fr;
    }
    
    .tmn-filter-row {
        flex-direction: column;
    }
    
    .tmn-filter-group {
        width: 100%;
    }
    
    .tmn-date-inputs {
        flex-direction: column;
    }
}
