/**
 * Modern News Widget Pro - Pokročilé styly
 * Soubor: assets/css/pro-styles.css
 */

/* ========== Kontrolní panel (filtry, vyhledávání) ========== */
.mnw-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* Vyhledávací pole */
.mnw-search-wrapper {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.mnw-search-input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid transparent;
    border-radius: 25px;
    background: white;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.mnw-search-input:focus {
    outline: none;
    border-color: #667EEA;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.mnw-search-button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 35px;
    height: 35px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #667EEA, #764BA2);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mnw-search-button:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 3px 8px rgba(118, 75, 162, 0.3);
}

/* Filtry kategorií */
.mnw-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.mnw-filter-item {
    padding: 8px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    background: white;
    color: #666;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.mnw-filter-item:hover {
    border-color: #667EEA;
    color: #667EEA;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
    background: rgba(102, 126, 234, 0.05);
}

.mnw-filter-item.active {
    background: linear-gradient(135deg, #667EEA, #764BA2);
    color: white !important;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(118, 75, 162, 0.3);
    transform: none;
}

.mnw-filter-item.active:hover {
    background: linear-gradient(135deg, #5a72e0, #6a4198);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(118, 75, 162, 0.4);
}

/* Řazení */
.mnw-sorting {
    min-width: 180px;
}

.mnw-sort-select {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mnw-sort-select:focus {
    outline: none;
    border-color: #667EEA;
}

/* ========== Vylepšené karty ========== */
.mnw-card {
    position: relative;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.mnw-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

/* Efekt pro obrázek */
.mnw-image {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
}

.mnw-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255,255,255,0.3), 
        transparent);
    transition: left 0.5s ease;
    z-index: 1;
}

.mnw-card:hover .mnw-image::before {
    left: 100%;
}

.mnw-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, filter 0.5s ease;
}

.mnw-card:hover .mnw-image img {
    transform: scale(1.1) rotate(2deg);
    filter: brightness(1.1);
}

/* Meta informace */
.mnw-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 12px;
    font-size: 12px;
    color: #999;
}

.mnw-meta > div {
    display: flex;
    align-items: center;
    gap: 5px;
}

.mnw-meta i {
    font-size: 11px;
    color: #667EEA;
}

.mnw-author a,
.mnw-comments a {
    color: #999;
    text-decoration: none;
    transition: color 0.3s ease;
}

.mnw-author a:hover,
.mnw-comments a:hover {
    color: #667EEA;
}

/* Počet zobrazení */
.mnw-views {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 2;
}

/* Štítky */
.mnw-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 15px;
    margin-bottom: 15px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.mnw-tag {
    display: inline-block;
    padding: 6px 14px;
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #e9ecef;
    border-radius: 25px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    line-height: 1.3;
    white-space: nowrap;
}

.mnw-tag:hover {
    background: linear-gradient(135deg, #667EEA, #764BA2);
    color: white;
    border-color: transparent;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

/* ========== Animace při načítání ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mnw-card {
    animation: fadeInUp 0.6s ease both;
}

.mnw-card:nth-child(1) { animation-delay: 0.1s; }
.mnw-card:nth-child(2) { animation-delay: 0.2s; }
.mnw-card:nth-child(3) { animation-delay: 0.3s; }
.mnw-card:nth-child(4) { animation-delay: 0.4s; }
.mnw-card:nth-child(5) { animation-delay: 0.5s; }
.mnw-card:nth-child(6) { animation-delay: 0.6s; }

/* ========== Loading stav ========== */
.mnw-loading {
    position: relative;
    min-height: 300px;
    opacity: 0.7;
    pointer-events: none;
}

.mnw-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f0f0f0;
    border-top-color: #667EEA;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 100;
}

.mnw-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 99;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ========== Stránkování ========== */
.mnw-pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 40px;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mnw-pagination-wrapper.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.mnw-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.mnw-pagination a,
.mnw-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 35px;
    height: 35px;
    padding: 0 12px;
    border-radius: 18px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.mnw-pagination a {
    background: white;
    color: #666;
    border: 2px solid #e0e0e0;
}

.mnw-pagination a:hover {
    background: linear-gradient(135deg, #667EEA, #764BA2);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(118, 75, 162, 0.3);
}

.mnw-pagination .current,
.mnw-pagination .mnw-pagination-current {
    background: linear-gradient(135deg, #667EEA, #764BA2);
    color: white;
    border: 2px solid transparent;
    box-shadow: 0 4px 12px rgba(118, 75, 162, 0.3);
}

/* Load More tlačítko ve stránkování */
.mnw-load-more-ajax,
.mnw-pagination-load-more button {
    background: linear-gradient(135deg, #667EEA, #764BA2) !important;
    color: #ffffff !important;
    border-radius: 25px !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    border: none !important;
    padding: 14px 32px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    min-height: auto;
}

.mnw-load-more-ajax:hover,
.mnw-pagination-load-more button:hover {
    background: linear-gradient(135deg, #5a72e0, #6a4198) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
    color: #ffffff !important;
}

.mnw-load-more-ajax:active,
.mnw-pagination-load-more button:active {
    transform: translateY(0);
}

.mnw-load-more-ajax.loading,
.mnw-pagination-load-more button.loading {
    opacity: 0.8;
    pointer-events: none;
}

.mnw-load-more-ajax.loading::after,
.mnw-pagination-load-more button.loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 10px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Previous/Next stránkování */
.mnw-pagination-prev-next {
    gap: 20px;
    align-items: center;
}

.mnw-pagination-info {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

/* ========== Nekonečné scrollování ========== */
.mnw-infinite-scroll-trigger {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
}

.mnw-infinite-scroll-trigger.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 3px solid #f0f0f0;
    border-top-color: #667EEA;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ========== Žádné výsledky ========== */
.mnw-no-posts {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.mnw-no-posts::before {
    content: '📭';
    display: block;
    font-size: 48px;
    margin-bottom: 20px;
}

/* ========== Hover efekty pro různé layouty ========== */

/* List layout hover */
.mnw-layout-list .mnw-card:hover {
    transform: translateX(10px);
}

/* Masonry layout hover */
.mnw-layout-masonry .mnw-card {
    transition: all 0.4s ease;
}

.mnw-layout-masonry .mnw-card:hover {
    transform: translateY(-5px) scale(1.03);
    z-index: 10;
}

/* Carousel hover */
.mnw-layout-carousel .mnw-card:hover {
    transform: scale(1.05);
    z-index: 10;
}

/* ========== Dark mode podpora ========== */
@media (prefers-color-scheme: dark) {
    .mnw-controls {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    }
    
    .mnw-search-input,
    .mnw-sort-select,
    .mnw-filter-item {
        background: #2c2c3e;
        color: #e0e0e0;
        border-color: #3c3c4e;
    }
    
    .mnw-card {
        background: #2c2c3e;
        box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    }
    
    .mnw-title a {
        color: #e0e0e0;
    }
    
    .mnw-excerpt {
        color: #b0b0b0;
    }
    
    .mnw-tag {
        background: #3c3c4e;
        color: #e0e0e0;
    }
}

/* ========== Responsivní design ========== */
@media (max-width: 768px) {
    .mnw-controls {
        padding: 15px;
        flex-direction: column;
        gap: 10px;
    }
    
    .mnw-search-wrapper {
        min-width: 100%;
        order: 1;
    }
    
    .mnw-filters {
        width: 100%;
        justify-content: center;
        order: 3;
    }
    
    .mnw-sorting {
        width: 100%;
        order: 2;
    }
    
    .mnw-card {
        animation-delay: 0s !important;
    }
    
    /* Carousel navigation mobile */
    .mnw-carousel-nav {
        justify-content: center;
        gap: 20px;
    }
    
    .mnw-carousel-nav button {
        width: 45px;
        height: 45px;
    }
}

/* ========== Print styly ========== */
@media print {
    .mnw-controls,
    .mnw-pagination,
    .mnw-load-more-wrapper,
    .mnw-carousel-nav {
        display: none !important;
    }
    
    .mnw-card {
        break-inside: avoid;
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}