/* ==========================================================================
   Pornocharts v8.0 - Frontend Styles
   ========================================================================== */

/* ---------- Toolbar (Datepicker + Filter) ---------- */
.pc-wrapper {
    margin: 20px 0;
}

.pc-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-start;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f8f8;
    border-radius: 8px;
    border: 1px solid #eee;
}

.pc-toolbar-left,
.pc-toolbar-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.pc-toolbar-label {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
}

.pc-select {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    min-width: 180px;
}

.pc-select:focus {
    outline: none;
    border-color: #e30613;
    box-shadow: 0 0 0 2px rgba(227, 6, 19, 0.15);
}

/* ---------- Kategorie-Filter Buttons ---------- */
.pc-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pc-filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    background: #fff;
    color: #555;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.pc-filter-btn:hover {
    border-color: #e30613;
    color: #e30613;
}

.pc-filter-btn.pc-filter-active {
    background: #e30613;
    color: #fff;
    border-color: #e30613;
}

/* ---------- Grid Layout ---------- */
.pc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    font-family: sans-serif;
}

/* ---------- List Layout ---------- */
.pc-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-family: sans-serif;
}

.pc-list .pc-card {
    flex-direction: row;
    max-height: 160px;
}

.pc-list .pc-img-wrap {
    width: 120px;
    min-width: 120px;
    aspect-ratio: auto;
    height: 160px;
}

.pc-list .pc-content {
    padding: 12px 15px;
    justify-content: center;
}

.pc-list .pc-title {
    font-size: 15px;
}

.pc-list .pc-btn {
    display: inline-block;
    width: auto;
    padding: 6px 16px;
    margin-top: 8px;
    font-size: 13px;
}

/* ---------- Card ---------- */
.pc-card {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    background: #fff;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pc-film-der-woche {
    overflow: visible;
}

.pc-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

/* ---------- Image ---------- */
.pc-img-wrap {
    position: relative;
    aspect-ratio: 2/3;
    background: #f0f0f0;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}

.pc-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.pc-card:hover .pc-img {
    transform: scale(1.03);
}

/* ---------- Position Badge ---------- */
.pc-pos {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #e30613;
    color: #fff;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 2;
}

/* ---------- Trend Indicator ---------- */
.pc-trend {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    z-index: 2;
}

.pc-trend-up {
    background: rgba(34, 139, 34, 0.9);
    color: #fff;
}

.pc-trend-down {
    background: rgba(220, 50, 50, 0.9);
    color: #fff;
}

.pc-trend-same {
    background: rgba(128, 128, 128, 0.8);
    color: #fff;
}

.pc-trend-new {
    background: rgba(255, 165, 0, 0.9);
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ---------- Content ---------- */
.pc-content {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.pc-title {
    font-size: 16px;
    margin: 0 0 5px 0;
    font-weight: 600;
    line-height: 1.3;
    color: #333;
}

.pc-title a {
    text-decoration: none;
    color: inherit;
}

.pc-title a:hover {
    color: #e30613;
}

.pc-meta {
    font-size: 13px;
    color: #777;
    margin-bottom: 10px;
}

.pc-tags {
    margin-top: auto;
}

.pc-tag {
    display: inline-block;
    background: #f4f4f4;
    color: #555;
    font-size: 11px;
    padding: 3px 6px;
    border-radius: 3px;
    margin: 0 4px 4px 0;
}

.pc-studio {
    color: #e30613;
    font-weight: bold;
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 5px;
    display: block;
}

.pc-btn {
    display: block;
    background: #333;
    color: #fff;
    text-align: center;
    padding: 10px;
    text-decoration: none;
    border-radius: 4px;
    margin-top: 10px;
    font-size: 14px;
    transition: background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.pc-btn:hover {
    background: #e30613;
    color: #fff;
}

.pc-empty {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-size: 16px;
}

.pc-debug {
    background: #eee;
    padding: 10px;
    border: 1px solid #ccc;
    margin-bottom: 15px;
    font-size: 12px;
    overflow-x: auto;
}

/* ---------- Film der Woche (Biggest Climber) ---------- */
.pc-film-der-woche {
    border: 2px solid #ffd700;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
    position: relative;
}

.pc-film-der-woche::before {
    content: '\2B50\00a0' attr(data-motw-label);
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    color: #333;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 0 0 6px 6px;
    z-index: 3;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pc-film-der-woche:hover {
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.35);
}

/* ---------- Skeleton Loading ---------- */
.pc-skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.pc-skeleton-card {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.pc-skeleton-img {
    aspect-ratio: 2/3;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: pc-shimmer 1.5s ease-in-out infinite;
}

.pc-skeleton-content {
    padding: 15px;
}

.pc-skeleton-line {
    height: 14px;
    border-radius: 4px;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: pc-shimmer 1.5s ease-in-out infinite;
}

.pc-skeleton-line:nth-child(1) { width: 40%; height: 10px; }
.pc-skeleton-line:nth-child(2) { width: 80%; height: 16px; }
.pc-skeleton-line:nth-child(3) { width: 60%; }
.pc-skeleton-line:nth-child(4) { width: 100%; height: 38px; border-radius: 4px; margin-top: 15px; }

@keyframes pc-shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ---------- Loading Overlay (for AJAX date switch) ---------- */
.pc-chart-container {
    position: relative;
    min-height: 200px;
}

.pc-chart-container.pc-loading {
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* ---------- Responsive ---------- */

/* Tablets */
@media (max-width: 768px) {
    .pc-toolbar {
        flex-direction: column;
        gap: 12px;
    }

    .pc-toolbar-left,
    .pc-toolbar-right {
        width: 100%;
    }

    .pc-select {
        width: 100%;
        min-width: unset;
    }

    .pc-filter-buttons {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
    }

    .pc-filter-buttons::-webkit-scrollbar {
        display: none;
    }

    .pc-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 12px;
    }

    .pc-list .pc-img-wrap {
        width: 100px;
        min-width: 100px;
        height: 130px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .pc-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .pc-card {
        border-radius: 6px;
    }

    .pc-content {
        padding: 10px;
    }

    .pc-title {
        font-size: 13px;
    }

    .pc-meta {
        font-size: 11px;
    }

    .pc-pos {
        font-size: 11px;
        padding: 3px 6px;
        top: 6px;
        left: 6px;
    }

    .pc-trend {
        font-size: 9px;
        padding: 2px 5px;
        top: 6px;
        right: 6px;
    }

    .pc-btn {
        padding: 8px;
        font-size: 13px;
        min-height: 44px; /* Touch-friendly */
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .pc-filter-btn {
        padding: 8px 14px;
        font-size: 13px;
        min-height: 36px; /* Touch-friendly */
    }

    .pc-tag {
        font-size: 10px;
        padding: 2px 5px;
    }

    .pc-studio {
        font-size: 10px;
    }

    .pc-list .pc-card {
        max-height: none;
        flex-direction: column;
    }

    .pc-list .pc-img-wrap {
        width: 100%;
        height: 180px;
    }

    .pc-skeleton-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* Small Mobile */
@media (max-width: 360px) {
    .pc-grid {
        grid-template-columns: 1fr;
    }

    .pc-skeleton-grid {
        grid-template-columns: 1fr;
    }
}

/* Large screens */
@media (min-width: 1200px) {
    .pc-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
}