/* TextGlam Formatter Dashboard CSS */
:root {
    --f-primary: #c4ff2e;
    --f-primary-hover: #b0e625;
    --f-text: #111115;
    --f-text-muted: #666666;
    --f-bg: #ffffff;
    --f-secondary-bg: #f8f9fa;
    --f-border: #eef2f6;
    --f-shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --f-shadow-md: 0 4px 16px rgba(0,0,0,0.06);
    --f-radius-sm: 8px;
    --f-radius-md: 12px;
    --f-radius-lg: 16px;
    --f-radius-full: 9999px;
    --f-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.formatter-container {
    width: 100%;
    margin: 0 auto;
    font-family: inherit;
}

/* Platform Selectors */
.platform-selector {
    display: flex;
    justify-content: flex-start;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.platform-btn {
    padding: 10px 20px;
    border: 1px solid var(--f-border);
    background: var(--f-bg);
    color: var(--f-text-muted);
    border-radius: var(--f-radius-full);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--f-transition);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--f-shadow-sm);
}

.platform-btn i { font-size: 16px; }

.platform-btn:hover {
    border-color: var(--f-primary);
    color: var(--f-text);
}

.platform-btn.active {
    background: var(--f-primary);
    color: #000000;
    border-color: var(--f-primary);
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(196,255,46,0.3);
}

/* Main Grid */
.main-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

@media (max-width: 991px) {
    .main-content-grid { grid-template-columns: 1fr; }
}

/* Editor Section */
.editor-section, .preview-section {
    background: var(--f-bg);
    border: 1px solid var(--f-border);
    border-radius: var(--f-radius-md);
    box-shadow: var(--f-shadow-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Toolbar */
.toolbar {
    background: var(--f-secondary-bg);
    padding: 12px 16px;
    border-bottom: 1px solid var(--f-border);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
    padding-right: 16px;
}

.toolbar-group:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 24px;
    width: 1px;
    background-color: #d8e2ea;
}

.toolbar-btn {
    width: 38px;
    height: 38px;
    border: 1px solid transparent;
    background: transparent;
    border-radius: var(--f-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: var(--f-transition);
    color: var(--f-text-muted);
    position: relative;
}

.toolbar-btn i { font-style: normal; } /* specifically for formatting */

.toolbar-btn:hover {
    background: var(--f-bg);
    border-color: var(--f-border);
    box-shadow: var(--f-shadow-sm);
    color: var(--f-text);
}

/* Text Editor */
.text-editor {
    min-height: 280px;
    padding: 20px;
    border: none;
    outline: none;
    resize: vertical;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.6;
    width: 100%;
    background: var(--f-bg);
    color: var(--f-text);
    flex: 1;
}

.editor-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--f-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--f-bg);
}

.char-counter {
    font-size: 13px;
    color: var(--f-text-muted);
}

.controls {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    background: var(--f-secondary-bg);
    border-top: 1px solid var(--f-border);
}

.control-btn {
    padding: 10px 24px;
    border: 1px solid #d8e2ea;
    background: var(--f-bg);
    color: var(--f-text);
    border-radius: var(--f-radius-md);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: var(--f-transition);
    box-shadow: var(--f-shadow-sm);
}

.control-btn:hover {
    border-color: #b0c4d6;
    transform: translateY(-1px);
}

.control-btn.primary {
    background: var(--f-primary);
    color: #000;
    border-color: var(--f-primary);
}

.control-btn.primary:hover {
    background: var(--f-primary-hover);
    border-color: var(--f-primary-hover);
    box-shadow: 0 4px 12px rgba(196,255,46,0.3);
}

/* Preview Section */
.preview-header {
    background: var(--f-bg);
    padding: 16px 20px;
    border-bottom: 1px solid var(--f-border);
    font-weight: 700;
    font-size: 16px;
    color: var(--f-text);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-options {
    display: flex;
    gap: 8px;
    background: var(--f-secondary-bg);
    padding: 4px;
    border-radius: var(--f-radius-sm);
}

.preview-option {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--f-transition);
    color: var(--f-text-muted);
}

.preview-option.active {
    background: var(--f-primary);
    color: #000;
    font-weight: bold;
}

.preview-content {
    padding: 32px 20px;
    background: var(--f-secondary-bg);
    min-height: 280px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
}

.social-post {
    background: var(--f-bg);
    border-radius: var(--f-radius-md);
    padding: 20px;
    box-shadow: var(--f-shadow-md);
    width: 100%;
    max-width: 500px;
    transition: var(--f-transition);
    border: 1px solid var(--f-border);
}

.social-post.mobile { max-width: 320px; }

.post-header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.profile-pic {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #f0f4f8;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-weight: bold;
    margin-right: 12px;
    font-size: 16px;
    border: 1px solid var(--f-border);
}

.profile-info h4 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 2px;
    color: var(--f-text);
}

.profile-info p {
    font-size: 13px;
    color: var(--f-text-muted);
    margin: 0;
}

.post-content {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 20px;
    word-wrap: break-word;
    color: var(--f-text);
}

.post-actions {
    display: flex;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid var(--f-border);
    font-size: 13px;
    color: var(--f-text-muted);
}

.action-buttons {
    display: flex;
    gap: 24px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--f-text-muted);
    text-decoration: none;
    font-weight: 500;
}

.action-btn:hover { color: var(--f-primary); }

/* Formats Grid */
.formats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.format-item {
    background: var(--f-bg);
    border: 1px solid var(--f-border);
    border-radius: var(--f-radius-md);
    padding: 24px;
    text-align: center;
    box-shadow: var(--f-shadow-sm);
    transition: var(--f-transition);
    display: flex;
    flex-direction: column;
}

.format-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--f-shadow-md);
    border-color: #b0c4d6;
}

.format-name {
    font-weight: 700;
    margin-bottom: 16px;
    font-size: 15px;
    color: var(--f-text);
}

.format-preview {
    background: var(--f-secondary-bg);
    border-radius: var(--f-radius-sm);
    padding: 16px;
    margin-bottom: 20px;
    min-height: 80px;
    max-height: 140px;
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
    color: var(--f-text);
    border: 1px solid #d8e2ea;
    flex: 1;
}

.copy-btn {
    padding: 10px 16px;
    border: 1px solid #d8e2ea;
    background: transparent;
    color: var(--f-text);
    border-radius: var(--f-radius-sm);
    cursor: pointer;
    font-size: 13px;
    transition: var(--f-transition);
    width: 100%;
    font-weight: 600;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.copy-btn:hover {
    background: var(--f-primary);
    border-color: var(--f-primary);
    color: #000;
}

/* Templates Section */
.templates-section {
    margin-bottom: 40px;
    margin-top: 40px;
}

.section-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 24px;
    color: var(--f-text);
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.template-card {
    background: var(--f-bg);
    border: 1px solid var(--f-border);
    border-radius: var(--f-radius-md);
    padding: 20px;
    cursor: pointer;
    transition: var(--f-transition);
    box-shadow: var(--f-shadow-sm);
    text-align: left;
}

.template-card:hover {
    border-color: var(--f-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(196,255,46,0.2);
}

.template-title {
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--f-text);
    font-size: 15px;
}

.template-description {
    font-size: 13px;
    color: var(--f-text-muted);
    margin-bottom: 16px;
    line-height: 1.5;
}

.template-preview {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: var(--f-secondary-bg);
    padding: 8px 12px;
    border-radius: var(--f-radius-sm);
}

/* Tooltip implementation */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(17, 17, 21, 0.9);
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    margin-bottom: 8px;
    z-index: 10;
    font-weight: 500;
}
[data-tooltip]:hover::after { opacity: 1; }
