/**
 * Styly pro vylepšený komentářový editor
 */

/* Wrapper */
.pm-comment-editor-wrapper {
    margin: 20px 0;
}

.pm-comment-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #2c3e50;
}

/* Toolbar */
.pm-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    flex-wrap: wrap;
}

.pm-toolbar-group {
    display: flex;
    gap: 2px;
}

.pm-toolbar-separator {
    width: 1px;
    height: 24px;
    background: #dee2e6;
    margin: 0 5px;
}

.pm-editor-btn {
    padding: 6px 10px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    color: #495057;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
}

.pm-editor-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-1px);
}

.pm-editor-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pm-emoji-trigger {
    font-size: 18px;
    padding: 4px 8px;
}

/* Emoji Picker */
.pm-emoji-picker {
    position: absolute;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    width: 320px;
    max-height: 400px;
    overflow: hidden;
    margin-top: 5px;
}

.pm-emoji-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 0;
}

.pm-emoji-tab {
    flex: 1;
    padding: 8px 4px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    color: #6c757d;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pm-emoji-tab:hover {
    background: #e9ecef;
}

.pm-emoji-tab.active {
    background: white;
    color: #667eea;
    font-weight: 600;
}

.pm-emoji-grid {
    padding: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.pm-emoji-category {
    display: none;
    grid-template-columns: repeat(8, 1fr);
    gap: 5px;
}

.pm-emoji-category.active {
    display: grid;
}

.pm-emoji-item {
    padding: 5px;
    text-align: center;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 20px;
    position: relative;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pm-emoji-item:hover {
    background: #f8f9fa;
    transform: scale(1.2);
}


/* Editor Container */
.pm-editor-container {
    position: relative;
}

.pm-comment-editor {
    min-height: 150px;
    padding: 15px;
    border: 1px solid #dee2e6;
    border-radius: 0 0 8px 8px;
    background: white;
    font-size: 15px;
    line-height: 1.6;
    outline: none;
    transition: border-color 0.2s;
}

.pm-comment-editor:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.pm-comment-editor[placeholder]:empty:before {
    content: attr(placeholder);
    color: #adb5bd;
    pointer-events: none;
}

/* Helper text */
.pm-editor-help {
    display: flex;
    gap: 15px;
    margin-top: 8px;
    font-size: 12px;
    color: #6c757d;
}

.pm-help-item kbd {
    padding: 2px 4px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    font-size: 11px;
}

/* Formátování v komentářích */
.pm-inline-code {
    padding: 2px 6px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #e83e8c;
}

blockquote.pm-quote {
    margin: 15px 0;
    padding: 10px 15px;
    border-left: 4px solid #667eea;
    background: #f8f9fa;
    font-style: italic;
}

/* Responzivní design */
@media (max-width: 768px) {
    .pm-editor-toolbar {
        padding: 8px;
    }
    
    .pm-editor-btn {
        padding: 5px 8px;
        min-width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .pm-emoji-picker {
        width: 280px;
    }
    
    .pm-emoji-category {
        grid-template-columns: repeat(7, 1fr);
    }
    
    .pm-emoji-item {
        font-size: 18px;
    }
    
    .pm-editor-help {
        flex-wrap: wrap;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .pm-toolbar-separator {
        display: none;
    }
    
    .pm-toolbar-group {
        flex-wrap: wrap;
    }
    
    .pm-emoji-tabs {
        flex-wrap: wrap;
    }
    
    .pm-emoji-tab {
        flex: 1 1 50%;
    }
    
    .pm-emoji-category {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* Pro nepřihlášené uživatele - zobrazit standardní textarea */
body:not(.logged-in) .pm-comment-editor-wrapper {
    display: none;
}

/* Animace */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pm-emoji-picker {
    animation: fadeIn 0.2s ease-out;
}

/* Efekt při vložení emoji */
@keyframes emojiPop {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
    }
}

.emoji-inserted {
    animation: emojiPop 0.3s ease-out;
}