/* T-FEED STORIES EDITOR: DESIGN PREMIUM (ESTILO INSTAGRAM) */
#tf-story-editor-container {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 100000;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-family: 'Inter', sans-serif;
    color: #fff;
    overflow: hidden;
}

/* 1. Preview Principal */
#tf-story-editor-preview-area {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-size: cover;
    background-position: center;
    border-radius: 12px;
}

#tf-story-editor-preview-area canvas {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* 2. Barra Superior (Controles Fechar/Limpar) */
.tf-v2-editor-top-bar {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

/* 3. Barra Lateral de Ferramentas (ESTILO INSTA) */
.tf-v2-editor-tools-sidebar {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 100;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(10px);
    padding: 10px;
    border-radius: 30px;
    border: 1px solid rgba(255,255,255,0.1);
}

.tf-v2-editor-tool-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.tf-v2-editor-tool-btn:active {
    transform: scale(0.9);
    background: rgba(255,255,255,0.1);
}

/* 4. Elementos Arrastáveis (Stickers, Textos) */
.tf-story-element {
    position: absolute;
    cursor: move;
    touch-action: none;
    user-select: none;
    padding: 8px 12px;
    border-radius: 8px;
    display: inline-block;
    z-index: 50;
    transform-origin: center center;
    white-space: pre-wrap;
    text-align: center;
}

/* Estilos de Texto */
.tf-story-text-element {
    font-weight: 800;
    font-size: 24px;
    color: #fff;
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.tf-story-text-highlight {
    background: var(--bg-color, #fff);
    color: var(--text-color, #000);
    padding: 10px 15px;
}

/* Link Button */
.tf-story-link-sticker {
    background: rgba(255,255,255,0.9);
    color: #000;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* 5. Barra Inferior (Publicar) */
.tf-v2-editor-bottom-bar {
    position: absolute;
    bottom: 30px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.tf-v2-btn-post-story {
    background: #fff;
    color: #000;
    font-weight: 800;
    padding: 12px 25px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
}
/* Font Selector Bar */
.tf-v2-editor-font-bar {
    position: absolute;
    bottom: 120px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 10px;
    overflow-x: auto;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(5px);
}

.tf-font-option {
    width: 60px;
    height: 35px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    display: flex;
    align-items: center;
    bottom: 0;
    justify-content: center;
    font-size: 11px;
    color: white;
    cursor: pointer;
    flex-shrink: 0;
}

.tf-font-option.active {
    background: #fff;
    color: #000;
    border-color: #fff;
}

/* Color Picker for Links/Text */
.tf-color-swatch {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #fff;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

/* Emoji Grid */
#tf-story-emoji-picker {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    height: 40%;
    background: #111;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    z-index: 100006;
    transition: bottom 0.3s ease;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    overflow-y: auto;
}

#tf-story-emoji-picker.open { bottom: 0; }

.tf-emoji-item {
    font-size: 35px;
    text-align: center;
    cursor: pointer;
}

/* Music Search Styles */
.tf-music-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.05);
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s;
}

.tf-music-item:active { transform: scale(0.95); }

.tf-music-art {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    object-fit: cover;
}

/* Drawing Canvas Overrides */
#tf-story-drawing-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 45;
    pointer-events: none;
    touch-action: none;
}

#tf-story-drawing-canvas.active { pointer-events: auto; }

/* Font definitions styles mapping */
.font-modern { font-family: 'Inter', sans-serif; font-style: italic; }
.font-classic { font-family: 'Merriweather', serif; font-weight: 700; }
.font-neon { font-family: 'Codystar', cursive; color: #fff; text-shadow: 0 0 5px #ff00ff, 0 0 10px #ff00ff; }
.font-elegant { font-family: 'Monsieur La Doulaise', cursive; font-size: 1.4em !important; }
.font-impact { font-family: 'Archivo Black', sans-serif; text-transform: uppercase; letter-spacing: -1px; }
.tf-element-remove-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #fff;
    color: #000;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    z-index: 5;
}

.tf-music-item:hover {
    background: rgba(255,255,255,0.1);
}

.text-ellipsis {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spin {
    animation: spin 1s linear infinite;
}
/* Seção de Musicas/Busca */
#tf-story-music-sheet {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    background: #111;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    height: 70%;
    z-index: 100008;
    transition: bottom 0.3s ease;
    padding: 20px;
}

#tf-story-music-sheet.open {
    bottom: 0;
}

/* Inputs e UI de edição ativa */
.tf-v2-editor-input-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 100010;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.tf-v2-editor-input-overlay input,
.tf-v2-editor-input-overlay textarea {
    background: none;
    border: none;
    color: white;
    font-size: 30px;
    text-align: center;
    width: 90%;
    font-weight: 800;
    outline: none;
}
