/* =========================================
   PLUGINHUB PRO - LISTS & COLLECTIONS CSS
   ========================================= */

/* --- PluginHub Collections Modal (Global Skeleton) --- */
.ph-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center; /* Desktopta ortalı */
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ph-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.ph-modal-wrap {
    background: var(--ph-bg-card);
    width: 100%;
    max-width: 400px;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.95);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    margin: 20px;
}

.ph-modal-overlay.active .ph-modal-wrap {
    transform: scale(1);
}

/* Header */
.ph-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--ph-border);
}

.ph-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--ph-accent);
}

.ph-modal-close {
    background: transparent;
    border: none;
    font-size: 20px;
    color: var(--ph-text-muted);
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s;
    display: flex;
    align-items: center;
}

.ph-modal-close:hover {
    color: var(--ph-accent);
}

/* Body */
.ph-modal-body {
    padding: 20px;
}

/* Footer */
.ph-modal-footer {
    background: var(--ph-bg-body);
    padding: 12px 20px;
    border-top: 1px solid var(--ph-border);
    margin: 0;
    font-size: 11px;
    color: var(--ph-text-muted);
    display: flex;
    gap: 6px;
}

.ph-modal-footer i,
.ph-modal-footer svg {
    margin-top: -1px;
}

/* --- 1. MY LISTS PAGE LAYOUT --- */
.ph-my-lists-wrap {
    display: flex;
    gap: 30px;
    width: 100% !important;
}

/* Sidebar Styling */
.ph-lists-sidebar {
    width: 300px;
    flex-shrink: 0;
}
.ph-sidebar-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--ph-text-main);
    font-family: var(--ph-font-main, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
}
.ph-lists-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    background: var(--ph-bg-card);
    border: 1px solid var(--ph-border);
    border-radius: var(--ph-radius, 12px);
    overflow: hidden;
}
.ph-lists-nav li {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid var(--ph-border);
    color: var(--ph-text-muted);
    font-weight: 500;
    font-size: 14px;
}
.ph-lists-nav li:last-child { 
    border-bottom: none; 
}

.ph-lists-nav li:hover {
    background: var(--ph-bg-body);
    color: var(--ph-accent);
}

.ph-lists-nav li.active {
    background: var(--ph-bg-body);
    color: var(--ph-accent);
    font-weight: 600;
}

/* Sidebar SVG Icons */
.ph-lists-nav li svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Sidebar Count Badge */
.ph-lists-nav li .ph-count {
    margin-left: auto;
    background: var(--ph-bg-body);
    color: var(--ph-text-muted);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}
.ph-lists-nav li.active .ph-count {
    background: var(--ph-bg-card);
    color: var(--ph-accent);
}

/* Content Area */
.ph-lists-content {
    flex: 1;
    min-width: 0;
}

.ph-lists-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--ph-border);
}

.ph-lists-header h1 {
    display: flex;
    gap: 10px;
    margin: 0;
    font-size: 24px;
    color: var(--ph-text-main);
    font-weight: 800;
}

.ph-lists-header h1 i,
.ph-lists-header h1 svg {
    font-size: 24px;
    width: 24px;
    height: 24px;
    fill: var(--ph-accent);
}

.ph-header-count {
    color: var(--ph-text-muted);
    font-weight: 600;
    font-size: 14px;
}

/* --- 2. GRID SYSTEM & CARDS (Main Content) --- */
.ph-lists-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

.ph-col-card {
    background: var(--ph-bg-card);
    border: 1px solid var(--ph-border);
    border-radius: var(--ph-radius, 12px);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
}

.ph-col-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
    border-color: var(--ph-accent);
}

.ph-col-thumb {
    position: relative;
    height: 150px;
    background: var(--ph-bg-body);
    overflow: hidden;
    border-bottom: 1px solid var(--ph-border);
}
.ph-col-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.ph-col-card:hover .ph-col-thumb img {
    transform: scale(1.05);
}

.ph-no-img {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--ph-text-muted);
    font-size: 48px;
}

/* Remove Actions (Hover) */
.ph-col-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 2;
}
.ph-col-card:hover .ph-col-actions {
    opacity: 1;
}

.ph-btn-remove-list {
position: absolute;
  top: 16px;
  left: 18px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--ph-bg-card);
    color: #ef4444; 
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    transition: all 0.2s;
}
.ph-btn-remove-list:hover {
    background: #ef4444;
    color: #fff;
    transform: scale(1.1);
    border-color: #ef4444;
}

.ph-col-body {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ph-col-title {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
}
.ph-col-title a {
    text-decoration: none;
    color: var(--ph-text-main);
    transition: color 0.2s;
}
.ph-col-title a:hover {
    color: var(--ph-accent);
}

.ph-col-meta {
    margin-top: auto;
    font-size: 12px;
    color: var(--ph-text-muted);
    display: flex;
    gap: 10px;
    align-items: center;
}
.ph-meta-ver {
    background: var(--ph-bg-body);
    color: var(--ph-accent);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 11px;
}

/* Empty State */
.ph-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--ph-text-muted);
    grid-column: 1 / -1;
    background: var(--ph-bg-body);
    border-radius: var(--ph-radius, 12px);
    border: 2px dashed var(--ph-border);
}
.ph-empty-state p {
    font-size: 16px;
    margin: 0;
    font-weight: 500;
}

/* Loader */
.ph-spinner {
    width: 40px;
    height: 40px;
    margin: 50px auto;
    border: 4px solid var(--ph-border);
    border-top: 4px solid var(--ph-accent);
    border-radius: 50%;
    animation: phSpin 1s linear infinite;
}
@keyframes phSpin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* --- 3. MODERN POPUP LIST STYLES (Grid Cards for Modal) --- */
#ph-lists-target {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.ph-list-card {
    background: var(--ph-bg-card);
    border: 1px solid var(--ph-border);
    border-radius: var(--ph-radius, 12px);
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    user-select: none;
    color: var(--ph-text-main);
}

.ph-list-card:hover {
    border-color: var(--ph-text-muted);
    background: var(--ph-bg-body);
}

/* Seçili Durum */
.ph-list-card.active {
    background: var(--ph-bg-card);
    border-color: var(--ph-accent);
    color: var(--ph-accent);
    box-shadow: 0 0 0 1px var(--ph-accent) inset;
}

/* Popup İkonları */
.ph-list-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    padding-top: 1px;
    color: var(--ph-text-muted);
    transition: color 0.2s;
}

.ph-list-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.ph-list-card.active .ph-list-icon {
    color: var(--ph-accent);
}

/* Popup Metinleri */
.ph-list-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.ph-list-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--ph-text-main);
}

.ph-list-card.active .ph-list-name {
    color: var(--ph-accent);
}

.ph-list-count-badge {
    font-size: 11px;
    color: var(--ph-text-muted);
    margin-top: 2px;
}

.ph-list-card.active .ph-list-count-badge {
    color: var(--ph-accent);
    opacity: 0.8;
}

/* --- 4. SMART COLLECTION BUTTON (Heart) --- */
.ph-collection-btn {
    position: relative;
    background: var(--ph-bg-card);
    cursor: pointer;
    color: var(--ph-text-muted);
    border: none;
    padding: 0;
    transition: all 0.2s ease;
    display: inline-flex;
}

/* Kart üzerindeki konumu */
.ph-card-thumb .ph-collection-btn {
    position: absolute;
    top: 16px;
    left: 18px;
    width: 32px;
    height: 32px;
    padding: 2px 0 0 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 9;
    border-radius: 50%;
}

.ph-collection-btn:hover {
    color: #ef4444;
    transform: scale(1.05);
}

/* Aktiflik Mantığı */
.ph-collection-btn.active .ph-icon-empty {
    display: none !important;
}
.ph-collection-btn.active .ph-icon-fill {
    display: inline-block !important;
    color: #ef4444; 
}
.ph-collection-btn .ph-icon-fill {
    display: none;
}

/* Badge (Sayaç) */
.ph-btn-badge {
    font-family: system-ui, -apple-system, sans-serif;
    position: absolute;
    top: -7px;
    right: -5px;
    background: var(--ph-accent);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    display: none; /* Varsayılan gizli */
    justify-content: center;
    align-items: center;
    border-radius: 9px;
    z-index: 2;
    line-height: 1;
    height: 14px;
    width: 14px;
}
.ph-collection-btn.active .ph-btn-badge {
    display: flex;
}
.ph-card-thumb .ph-btn-badge {
    top: -4px;
    left: 21px;
    right: auto;
}

/* --- 5. RATING TOOLTIP STYLES --- */
.ph-star-btn {
    position: relative; 
}

/* Tooltip Gövdesi */
.ph-star-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--ph-text-main);
    color: var(--ph-bg-card);
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 8px;
}

/* Tooltip Oku */
.ph-star-btn::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    border-width: 5px;
    border-style: solid;
    border-color: var(--ph-text-main) transparent transparent transparent;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    pointer-events: none;
    z-index: 10;
    margin-bottom: -2px;
}

.ph-star-btn:hover::after,
.ph-star-btn:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .ph-my-lists-wrap {
        flex-direction: column;
    }
    .ph-lists-sidebar {
        width: 100%;
    }
    .ph-lists-nav {
display: grid; /* Flex yerine Grid düzenine geçiyoruz */
    border-radius: var(--ph-radius, 8px);
    }
    .ph-lists-grid {
        grid-template-columns: 1fr;
    }
    #ph-lists-target {
        grid-template-columns: 1fr;
    }
}