/* Telegram Content Management Styles */

.content-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 20px;
}

.content-filter-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.content-filter-btn {
    padding: 10px 20px;
    border: 2px solid transparent;
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.content-filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 0;
}

.content-filter-btn span {
    position: relative;
    z-index: 1;
}

.content-filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: var(--text-primary);
}

.content-filter-btn.active {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    border-color: var(--accent);
    color: white;
    box-shadow: 0 4px 16px rgba(var(--accent-rgb), 0.3);
}

/* Posts Grid */
.telegram-posts-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
}

.telegram-post-card {
    position: relative;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.telegram-post-card:hover {
    border-color: var(--accent);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

.post-status-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(8px);
}

.post-status-badge.draft {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.post-status-badge.published {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.post-status-badge.scheduled {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.post-card-header {
    margin-bottom: 16px;
}

.post-card-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    line-height: 1.5;
    padding-right: 120px;
    letter-spacing: -0.01em;
}

.post-card-meta {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.post-photo-preview {
    margin: 16px 0;
    border-radius: 12px;
    overflow: hidden;
    max-height: 220px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.post-photo-preview img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.telegram-post-card:hover .post-photo-preview img {
    transform: scale(1.05);
}

.post-card-content {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
    word-break: break-word;
}

.post-published-at {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border-radius: 10px;
    font-weight: 500;
    border-left: 3px solid var(--accent);
}

.post-card-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color-light);
}

.post-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    border: 2px solid transparent;
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.post-action-btn svg {
    transition: transform 0.25s ease;
}

.post-action-btn:hover svg {
    transform: scale(1.1);
}

.post-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.post-action-btn:active {
    transform: translateY(0);
}

.post-action-btn.publish {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.post-action-btn.publish:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.post-action-btn.view {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.post-action-btn.view:hover {
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.post-action-btn.edit {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.post-action-btn.edit:hover {
    background: #6b7280;
    color: white;
    border-color: #6b7280;
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

.post-action-btn.delete {
    background: var(--bg-secondary);
    color: #ef4444;
    border-color: #ef444440;
}

.post-action-btn.delete:hover {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border-color: #ef4444;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Post Editor Modal */
.telegram-post-editor-dialog,
.telegram-settings-dialog {
    max-width: 700px;
    width: 90vw;
}

.telegram-post-editor-content,
.telegram-settings-content {
    padding: 24px;
}

.telegram-editor-field {
    display: block;
    margin-bottom: 20px;
}

.telegram-editor-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.telegram-editor-field input[type="text"],
.telegram-editor-field input[type="url"],
.telegram-editor-field textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
    transition: all 0.25s ease;
}

.telegram-editor-field textarea {
    font-family: 'JetBrains Mono', monospace;
    resize: vertical;
    min-height: 200px;
    line-height: 1.6;
}

/* EasyMDE customization */
.telegram-editor-field .EasyMDEContainer {
    margin-top: 8px;
}

.telegram-editor-field .EasyMDEContainer .CodeMirror {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
}

.telegram-editor-field .EasyMDEContainer .CodeMirror-cursor {
    border-left-color: var(--accent);
}

.telegram-editor-field .editor-toolbar {
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    background: var(--bg-secondary);
}

.telegram-editor-field .editor-toolbar button {
    color: var(--text-primary);
}

.telegram-editor-field .editor-toolbar button:hover,
.telegram-editor-field .editor-toolbar button.active {
    background: var(--accent-secondary);
    border-color: var(--accent);
    color: var(--accent);
}

.telegram-editor-field .editor-toolbar i.separator {
    border-left-color: var(--border-color);
}

.telegram-editor-field .editor-statusbar {
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
    background: var(--bg-secondary);
}

.telegram-editor-field .CodeMirror-fullscreen {
    background: var(--bg-primary);
    z-index: 10000;
}

.telegram-editor-field .editor-preview,
.telegram-editor-field .editor-preview-side {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.telegram-editor-field .editor-preview-side {
    border-left: 1px solid var(--border-color);
}

.telegram-editor-field input:focus,
.telegram-editor-field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.15);
    transform: translateY(-1px);
}

.telegram-editor-hint {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.telegram-editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color-light);
}

/* Info and error messages */
.info-message {
    padding: 20px;
    background: var(--accent-secondary);
    border: 1px solid var(--accent);
    border-radius: 8px;
    color: var(--accent);
    text-align: center;
    font-size: 14px;
}

.error-message {
    padding: 20px;
    background: #fef2f2;
    border: 1px solid #ef4444;
    border-radius: 8px;
    color: #dc2626;
    text-align: center;
    font-size: 14px;
}

/* Enhanced primary button for Telegram content */
.content-toolbar .btn-primary,
.telegram-editor-actions .btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 4px 16px rgba(var(--accent-rgb), 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.content-toolbar .btn-primary::before,
.telegram-editor-actions .btn-primary::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;
}

.content-toolbar .btn-primary:hover::before,
.telegram-editor-actions .btn-primary:hover::before {
    left: 100%;
}

.content-toolbar .btn-primary:hover,
.telegram-editor-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(var(--accent-rgb), 0.4);
}

.content-toolbar .btn-primary:active,
.telegram-editor-actions .btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.3);
}

.content-toolbar .btn-primary svg,
.telegram-editor-actions .btn-primary svg {
    transition: transform 0.3s ease;
}

.content-toolbar .btn-primary:hover svg,
.telegram-editor-actions .btn-primary:hover svg {
    transform: rotate(90deg);
}

/* Secondary buttons in editor */
.telegram-editor-actions .secondary-button {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.25s ease;
}

.telegram-editor-actions .secondary-button:hover {
    background: var(--bg-primary);
    border-color: var(--text-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Loading state */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .telegram-posts-grid {
        grid-template-columns: 1fr;
    }

    .content-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .content-filter-tabs {
        justify-content: space-between;
    }

    .telegram-post-editor-dialog,
    .telegram-settings-dialog {
        width: 95vw;
    }

    .post-card-title {
        padding-right: 110px;
        font-size: 16px;
    }

    .post-card-actions {
        gap: 8px;
    }

    .post-action-btn {
        padding: 8px 14px;
        font-size: 12px;
    }
}
