/**
 * Calendar Widget Styles (Bootstrap 5)
 *
 * @package Tarancon_Digital
 */

.tarancon-calendar-widget {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Calendar Grid */
.calendar-grid {
    margin-top: 1rem;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
    margin-bottom: 0.25rem;
}

.calendar-weekday {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.5rem 0;
    color: rgba(255, 255, 255, 0.9);
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
}

.calendar-day {
    aspect-ratio: 1;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.9);
}

.calendar-day:hover {
    background: rgba(255, 255, 255, 0.2);
}

.calendar-day.empty {
    cursor: default;
    background: transparent !important;
}

.calendar-day.today {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    font-weight: 700;
}

.calendar-day.selected {
    background: white !important;
    color: #0d6efd;
    box-shadow: 0 0 0 2px white;
    transform: scale(1.1);
    font-weight: 700;
}

.calendar-day.has-articles::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: #ffc107;
    border-radius: 50%;
}

.calendar-day.selected.has-articles::after {
    display: none;
}

/* Search Input */
.search-input {
    font-size: 0.875rem;
}

.search-input:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Category Buttons */
.category-buttons {
    max-height: 150px;
    overflow-y: auto;
}

.category-btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    border: 1px solid #dee2e6;
    background: #f8f9fa;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.category-btn:hover {
    background: #e9ecef;
    border-color: #ced4da;
}

.category-btn.active {
    background: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

/* Articles List */
.articles-list {
    min-height: 200px;
}

.article-card {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s;
    cursor: pointer;
    background: white;
}

.article-card:hover {
    border-color: #0d6efd;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transform: translateY(-1px);
}

.article-card:last-child {
    margin-bottom: 0;
}

.article-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 0.375rem;
    flex-shrink: 0;
}

.article-category-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 600;
    white-space: nowrap;
}

.article-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.article-card:hover .article-title {
    color: #0d6efd;
}

.article-summary {
    font-size: 0.75rem;
    color: #6c757d;
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-date {
    font-size: 0.75rem;
    color: #6c757d;
}

/* Category Colors */
.cat-local { background: #cfe2ff; color: #084298; }
.cat-nacional { background: #f8d7da; color: #842029; }
.cat-deportes { background: #d1e7dd; color: #0f5132; }
.cat-cultura { background: #e2d9f3; color: #59247a; }
.cat-economia { background: #fff3cd; color: #664d03; }
.cat-comarca { background: #ffe5d0; color: #984c0c; }
.cat-provincial { background: #e7d6f5; color: #3d0a5c; }

/* Empty State */
.empty-state {
    text-align: center;
    padding: 2rem 1rem;
}

.empty-state-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    opacity: 0.3;
}

.empty-state-text {
    font-size: 0.875rem;
    color: #6c757d;
}

/* Loading State */
.loading-state {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

/* Results Count */
.results-count {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Scrollbar Customization */
.category-buttons::-webkit-scrollbar {
    width: 4px;
}

.category-buttons::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.category-buttons::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 2px;
}

.category-buttons::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive */
@media (max-width: 576px) {
    .calendar-weekday {
        font-size: 0.7rem;
        padding: 0.375rem 0;
    }

    .calendar-day {
        font-size: 0.75rem;
    }

    .article-image {
        width: 60px;
        height: 60px;
    }

    .article-title {
        font-size: 0.8125rem;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.article-card {
    animation: fadeIn 0.3s ease-out;
}

/* Button Styles */
.calendar-prev,
.calendar-next {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    transition: all 0.2s;
}

.calendar-prev:hover,
.calendar-next:hover {
    background: rgba(255, 255, 255, 0.9) !important;
    transform: scale(1.05);
}

.clear-selection {
    font-size: 0.75rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.clear-selection:hover {
    text-decoration: underline;
}

.show-all-btn {
    font-size: 0.875rem;
    padding: 0.625rem;
}
