/**
 * Designer Clipart Browser - CSS (Modern)
 *
 * Clipart könyvtár böngésző stílusok
 *
 * @package    Designer Module
 * @subpackage CSS
 * @author     Kilo Code AI
 * @version    2.0.0
 */

/* ============================================
   OVERLAY
   ============================================ */

#clipart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal-backdrop);
    display: none;
    opacity: 0;
    transition: opacity var(--transition-base);
}

#clipart-overlay.open {
    display: block;
    opacity: 1;
}

/* ============================================
   CLIPART PANEL
   ============================================ */

#clipart-panel {
    position: fixed;
    right: -420px;
    top: 0;
    width: 420px;
    height: 100vh;
    background: var(--bg-elevated);
    box-shadow: var(--shadow-xl);
    transition: right var(--transition-slow);
    z-index: var(--z-modal);
    display: flex;
    flex-direction: column;
}

#clipart-panel.open {
    right: 0;
}

body.clipart-panel-open {
    overflow: hidden;
}

/* ============================================
   PANEL HEADER
   ============================================ */

.clipart-panel-header {
    padding: var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.clipart-panel-header h3 {
    margin: 0;
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
}

.clipart-panel-header h3 i {
    margin-right: var(--space-2);
    color: var(--accent-primary);
}

#btn-close-clipart {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

#btn-close-clipart:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* ============================================
   KERESÉS
   ============================================ */

.clipart-search {
    padding: var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-elevated);
    flex-shrink: 0;
}

#clipart-search {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all var(--transition-base);
}

#clipart-search:hover {
    border-color: var(--border-medium);
}

#clipart-search:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-accent);
    background: var(--bg-elevated);
}

#clipart-search::placeholder {
    color: var(--text-tertiary);
}

/* ============================================
   KATEGÓRIÁK
   ============================================ */

.clipart-categories {
    padding: var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--border-light);
    overflow-x: auto;
    white-space: nowrap;
    background: var(--bg-elevated);
    flex-shrink: 0;
}

.clipart-category-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-3) var(--space-4);
    margin-right: var(--space-2);
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    min-width: 80px;
}

.clipart-category-btn:hover {
    background: var(--bg-tertiary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-medium);
}

.clipart-category-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.clipart-category-btn i {
    font-size: 24px;
    margin-bottom: var(--space-2);
}

.clipart-category-btn span {
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
}

/* ============================================
   CLIPART GRID
   ============================================ */

.clipart-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-6);
    background: var(--bg-secondary);
}

#clipart-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
}

.clipart-item {
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
}

.clipart-item:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    border-color: var(--accent-primary);
}

/* Kattintható jelzés a thumbnail-en hover állapotban */
.clipart-item:hover .clipart-thumbnail::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(59, 130, 246, 0.1);
    pointer-events: none;
    transition: all var(--transition-base);
}

/* Plusz ikon megjelenítése hover-nél - CSS-alapú megoldás */
.clipart-item:hover .clipart-thumbnail::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background:
        linear-gradient(var(--accent-primary), var(--accent-primary)),
        linear-gradient(var(--accent-primary), var(--accent-primary));
    background-size: 4px 40px, 40px 4px;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.8;
    pointer-events: none;
    z-index: 1;
    animation: fadeInScale 0.2s ease;
    border-radius: 50%;
    box-shadow: 0 0 0 8px rgba(59, 130, 246, 0.2);
}

.clipart-thumbnail {
    width: 100%;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    padding: var(--space-4);
    position: relative;
}

.clipart-thumbnail img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.clipart-info {
    padding: var(--space-3);
    background: var(--bg-elevated);
}

.clipart-name {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    margin-bottom: var(--space-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.clipart-actions {
    display: flex;
    gap: var(--space-2);
}

.clipart-actions button {
    flex: 1;
    padding: var(--space-2) var(--space-3);
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
}

.clipart-actions button:hover {
    background: var(--accent-primary-hover);
    transform: scale(1.05);
    box-shadow: var(--shadow-sm);
}

.clipart-actions button i {
    margin-right: var(--space-1);
}

/* ============================================
   ÜRES ÁLLAPOT
   ============================================ */

.clipart-empty {
    text-align: center;
    padding: var(--space-16) var(--space-6);
    color: var(--text-tertiary);
}

.clipart-empty i {
    font-size: 64px;
    margin-bottom: var(--space-6);
    opacity: 0.3;
}

.clipart-empty p {
    font-size: var(--text-base);
    margin: 0;
}

/* ============================================
   LOADING ÁLLAPOT
   ============================================ */

.clipart-loading {
    text-align: center;
    padding: var(--space-16) var(--space-6);
    color: var(--accent-primary);
    font-size: var(--text-base);
}

.clipart-loading i {
    font-size: 32px;
    margin-bottom: var(--space-4);
    animation: spin 1s linear infinite;
}

/* ============================================
   HIBA ÁLLAPOT
   ============================================ */

.clipart-error {
    text-align: center;
    padding: var(--space-16) var(--space-6);
    color: var(--accent-danger);
    font-size: var(--text-base);
}

/* ============================================
   LAPOZÁS
   ============================================ */

.clipart-pagination {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-2);
    background: var(--bg-elevated);
    flex-shrink: 0;
}

.page-btn {
    padding: var(--space-2) var(--space-3);
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    font-size: var(--text-sm);
    color: var(--text-primary);
    min-width: 36px;
    font-weight: var(--font-medium);
}

.page-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

.page-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    font-weight: var(--font-semibold);
}

.page-dots {
    padding: var(--space-2) var(--space-3);
    color: var(--text-tertiary);
    font-size: var(--text-sm);
}

/* ============================================
   CLIPART GOMB (ESZKÖZTÁR)
   ============================================ */

#btn-open-clipart {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

#btn-open-clipart i {
    font-size: 16px;
}

/* ============================================
   RESZPONZÍV
   ============================================ */

@media (max-width: 768px) {
    #clipart-panel {
        width: 100%;
        right: -100%;
    }
    
    #clipart-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .clipart-thumbnail {
        height: 120px;
        padding: 10px;
    }
    
    .clipart-categories {
        padding: 12px 15px;
    }
    
    .clipart-category-btn {
        padding: 10px 12px;
        margin-right: 8px;
        min-width: 70px;
    }
    
    .clipart-category-btn i {
        font-size: 20px;
    }
    
    .clipart-category-btn span {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    #clipart-grid {
        grid-template-columns: 1fr;
    }
    
    .clipart-panel-header {
        padding: 12px 15px;
    }
    
    .clipart-panel-header h3 {
        font-size: 16px;
    }
}

/* ============================================
   ANIMÁCIÓK
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1);
    }
}

.clipart-item {
    animation: fadeIn 0.3s ease;
}

/* ============================================
   DARK MODE TÁMOGATÁS (OPCIONÁLIS)
   ============================================ */

@media (prefers-color-scheme: dark) {
    #clipart-panel {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .clipart-panel-header {
        background: #1a202c;
        border-bottom-color: #4a5568;
    }
    
    .clipart-panel-header h3 {
        color: #e2e8f0;
    }
    
    .clipart-search,
    .clipart-categories,
    .clipart-pagination {
        background: #2d3748;
        border-bottom-color: #4a5568;
        border-top-color: #4a5568;
    }
    
    #clipart-search {
        background: #1a202c;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .clipart-content {
        background: #1a202c;
    }
    
    .clipart-item {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .clipart-thumbnail {
        background: #1a202c;
    }
    
    .clipart-info {
        background: #2d3748;
    }
    
    .clipart-name {
        color: #e2e8f0;
    }
    
    .clipart-category-btn {
        background: #1a202c;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .clipart-category-btn:hover {
        background: #4a5568;
    }
    
    .page-btn {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .page-btn:hover {
        background: #4a5568;
    }
}
