/* Reset + Tema Escuro */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a0a;
    color: #e0e0e0;
    height: 100vh;
    overflow: hidden;
}

.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header */
.app-header {
    background: #111111;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #222;
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #00d4ff;
}

.subtitle {
    color: #666;
    font-size: 0.95rem;
}

/* Two-pane layout - Mobile-First */
.two-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar {
    background: #181818;
    border-right: 1px solid #222;
    width: 100%;
    max-height: 40vh;
    overflow-y: auto;
}

.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    background: #111111;
    overflow: hidden;
}

/* Responsivo - Dois painéis em telas maiores */
@media (min-width: 768px) {
    .two-pane {
        flex-direction: row;
    }
    .sidebar {
        width: 320px;
        max-height: none;
        min-width: 280px;
    }
    .main-area {
        flex: 1;
    }
}

/* Sidebar */
.sidebar-header {
    padding: 1rem 1.25rem;
    background: #1f1f1f;
    border-bottom: 1px solid #222;
    position: sticky;
    top: 0;
    z-index: 10;
}

.sidebar-header h2 {
    font-size: 1.1rem;
    color: #aaa;
}

.history-list {
    list-style: none;
}

.history-item {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #222;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s;
}

.history-item:hover {
    background: #222222;
}

.item-info strong {
    font-size: 0.95rem;
    color: #00d4ff;
}

.item-info p {
    font-size: 0.85rem;
    color: #ccc;
    margin-top: 4px;
    word-break: break-all;
    max-width: 220px;
}

.item-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.item-meta small {
    font-size: 0.75rem;
    color: #666;
}

.delete-btn {
    font-size: 1.3rem;
    color: #ff4d4d;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.delete-btn:hover {
    background: rgba(255, 77, 77, 0.15);
    transform: scale(1.2);
}

/* Main Area */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.main-header h2 {
    font-size: 1.35rem;
    color: #ddd;
}

#editor {
    flex: 1;
    width: 100%;
    background: #1a1a1a;
    color: #e0e0e0;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 1.25rem;
    font-family: 'SF Mono', Menlo, monospace;
    font-size: 1rem;
    line-height: 1.5;
    resize: none;
    outline: none;
    transition: border 0.2s;
}

#editor:focus {
    border-color: #00d4ff;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
}

#editor[readonly] {
    background: #1f1f1f;
    color: #aaa;
}

/* Botões */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.btn-primary {
    background: #00d4ff;
    color: #000;
}

.btn-primary:hover {
    background: #00b8e0;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #333;
    color: #ddd;
}

.btn-secondary:hover {
    background: #444;
}

.btn-accent {
    background: #28a745;
    color: white;
}

.btn-accent:hover {
    background: #218838;
}

.actions {
    display: flex;
    gap: 12px;
    margin: 1rem 0;
}

.upload-section {
    margin-top: auto;
    padding: 1.25rem;
    background: #1a1a1a;
    border-radius: 8px;
    border: 1px solid #222;
}

.upload-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.upload-section input[type="file"] {
    flex: 1;
    color: #ccc;
}

.help-text {
    display: block;
    margin-top: 8px;
    font-size: 0.8rem;
    color: #666;
}

/* Scrollbar custom (dark) */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 20px;
}