/**
 * X Post Block Styles (Grid System)
 * 
 * Additional styles for X Post block in grid layout.
 * Extends existing x-post styles from index-shared.css
 */

/* ============================================================================
   BASE CONTAINER
   ============================================================================ */

.x-post-block-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    padding: 0 !important;
    box-sizing: border-box;
}

/* ============================================================================
   PLACEHOLDER STATE
   ============================================================================ */

.x-post-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--color-text-muted, #64748b);
    text-align: center;
    padding: 16px;
    box-sizing: border-box;
}

.x-post-placeholder .placeholder-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
    opacity: 0.6;
}

.x-post-placeholder .placeholder-text {
    font-size: 0.875rem;
    font-style: italic;
}

/* ============================================================================
   VIEW MODE
   ============================================================================ */

.x-post-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 12px;
    box-sizing: border-box;
    overflow: auto;
}

.x-post-view .x-post-embed-container {
    width: 100%;
    max-width: 100%;
}

/* Make Twitter embed responsive */
.x-post-view .twitter-tweet {
    margin: 0 auto !important;
    max-width: 100% !important;
}

/* ============================================================================
   EDIT MODE
   ============================================================================ */

.x-post-editor {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    padding: 12px;
    box-sizing: border-box;
    overflow-y: auto;
    gap: 12px;
}

.x-post-editor-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.x-post-editor-header .x-logo-large {
    font-size: 1.5rem;
    color: var(--color-text-primary, #f1f5f9);
}

.x-post-editor-header .x-post-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-primary, #f1f5f9);
}

.x-post-url-wrapper {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.x-post-editor .x-post-url-input {
    flex: 1;
    padding: 10px 12px;
    font-size: 0.875rem;
    color: var(--color-text-primary, #f1f5f9);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(var(--color-primary-rgb, 99, 102, 241), 0.3);
    border-radius: 6px;
    outline: none;
    transition: all 0.15s ease;
}

.x-post-editor .x-post-url-input:focus {
    border-color: var(--color-primary, #6366f1);
    box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb, 99, 102, 241), 0.15);
}

.x-post-editor .x-post-url-input::placeholder {
    color: var(--color-text-muted, #94a3b8);
}

.x-post-paste-btn {
    all: unset;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    background: rgba(var(--color-primary-rgb, 99, 102, 241), 0.1);
    border: 1px solid rgba(var(--color-primary-rgb, 99, 102, 241), 0.3);
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.15s ease;
}

.x-post-paste-btn:hover {
    background: rgba(var(--color-primary-rgb, 99, 102, 241), 0.2);
    border-color: rgba(var(--color-primary-rgb, 99, 102, 241), 0.5);
}

.x-post-editor .x-post-hint {
    font-size: 0.7rem;
    color: var(--color-text-muted, #94a3b8);
    margin: 0;
}

.x-post-editor .x-post-preview-section {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
}

/* Loading state in editor */
.x-post-editor .x-post-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--color-text-muted, #94a3b8);
    font-size: 0.875rem;
}

.x-post-editor .x-post-loading .x-logo {
    font-size: 1.5rem;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Preview placeholder in editor */
.x-post-editor .x-post-preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--color-text-muted, #94a3b8);
    text-align: center;
}

.x-post-editor .x-post-preview-placeholder .x-logo {
    font-size: 2rem;
    opacity: 0.5;
}

.x-post-editor .x-post-preview-placeholder p {
    font-size: 0.8rem;
    margin: 0;
}

/* Error state */
.x-post-editor .x-post-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #f87171;
    font-size: 0.875rem;
    padding: 16px;
    background: rgba(248, 113, 113, 0.1);
    border-radius: 8px;
}

/* ============================================================================
   SCROLLBAR
   ============================================================================ */

.x-post-editor::-webkit-scrollbar,
.x-post-view::-webkit-scrollbar {
    width: 4px;
}

.x-post-editor::-webkit-scrollbar-track,
.x-post-view::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
}

.x-post-editor::-webkit-scrollbar-thumb,
.x-post-view::-webkit-scrollbar-thumb {
    background: rgba(var(--color-primary-rgb, 99, 102, 241), 0.3);
    border-radius: 2px;
}

