/* Lembrei - Estilos Customizados */
@import url('https://cdn.tailwindcss.com');

/* Configuração de cores customizadas */
:root {
    --main-bg: #000000;
    --sidebar-bg: #333333;
    --editor-bg: #000000;
    --card-bg: #333333;
    --giallo-roma: #FFDA61;
    --rosso-roma: #A52A2A;
    --secondary-gray: #333333;
    --border-dark: #555555;
    --text-primary: #FFFFFF;
    --text-secondary: #CCCCCC;
    --text-muted: #999999;
}

/* Reset e configurações base */
* {
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--main-bg);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    min-height: 100vh;
}

/* Classes utilitárias customizadas */
.bg-main-bg { background-color: var(--main-bg); }
.bg-sidebar-bg { background-color: var(--sidebar-bg); }
.bg-editor-bg { background-color: var(--editor-bg); }
.bg-card-bg { background-color: var(--card-bg); }
.bg-giallo-roma { background-color: var(--giallo-roma); }
.bg-rosso-roma { background-color: var(--rosso-roma); }
.bg-secondary-gray { background-color: var(--secondary-gray); }

.text-giallo-roma { color: var(--giallo-roma); }
.text-rosso-roma { color: var(--rosso-roma); }
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }

.border-dark { border-color: var(--border-dark); }

/* Hover states para cores customizadas */
.hover\:bg-giallo-roma:hover { background-color: var(--giallo-roma); }
.hover\:bg-rosso-roma:hover { background-color: var(--rosso-roma); }
.hover\:bg-yellow-500:hover { background-color: #EAB308; }
.hover\:bg-red-600:hover { background-color: #DC2626; }
.hover\:text-primary:hover { color: var(--text-primary) !important; }

/* Layout principal */
.main-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 12rem;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-dark);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Container scrollável para as seções de pastas e tags */
.sidebar-scrollable-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 1rem;
}

.sidebar-scrollable-container::-webkit-scrollbar {
    width: 6px;
}

.sidebar-scrollable-container::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-scrollable-container::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 3px;
}

.sidebar-scrollable-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-dark);
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

.sidebar-title i {
    color: var(--giallo-roma);
    margin-right: 0.5rem;
}

/* User Info Styles */
.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-dark);
}

.user-welcome {
    display: flex;
    align-items: center;
    flex: 1;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.user-badge {
    background: #dc2626;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.7rem;
    margin-left: 4px;
}

.user-actions {
    display: flex;
    gap: 8px;
}

.user-action-btn {
    color: #6b7280;
    text-decoration: none;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.15s ease-in-out;
    font-size: 0.9rem;
}

.user-action-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

/* Área de logout */
.user-logout-area {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-dark);
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background-color: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.3);
    border-radius: 0.375rem;
    color: #dc2626;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background-color: rgba(220, 38, 38, 0.2);
    border-color: rgba(220, 38, 38, 0.5);
    color: #ef4444;
    transform: translateY(-1px);
}

.logout-btn i {
    margin-right: 0.5rem;
    font-size: 0.875rem;
}

.logout-btn span {
    font-weight: 500;
}

/* Notes Panel */
.notes-panel {
    width: 20rem;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-dark);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.notes-panel .notes-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

/* Botões */
.btn-primary {
    width: 100%;
    background-color: var(--giallo-roma);
    color: #000000;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

.btn-primary i {
    color: #000000 !important;
    font-weight: bold;
}

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

.btn-save {
    background-color: var(--giallo-roma);
    color: #000000;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-weight: 500;
}

.btn-save:hover {
    background-color: #EAB308;
}

.btn-delete {
    background-color: var(--rosso-roma);
    color: var(--text-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-weight: 500;
}

.btn-delete:hover {
    background-color: #DC2626;
}

/* Seções da sidebar */
.sidebar-section {
    padding: 0 1rem;
    padding-bottom: 0.5rem;
}

.sidebar-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.sidebar-section-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-section-count {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Botão de nova pasta */
#newFolderBtn {
    background: none !important;
    border: none !important;
    padding: 0.25rem !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

#newFolderBtn i {
    color: #FFFFFF !important;
    font-size: 0.75rem;
    font-weight: normal;
}

#newFolderBtn:hover i {
    color: var(--giallo-roma) !important;
}

/* Seção de Busca */
.search-section {
    padding: 0 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-dark);
    margin-bottom: 1rem;
}

.search-container {
    width: 100%;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    pointer-events: none;
    z-index: 1;
}

.search-input {
    width: 100%;
    background-color: var(--card-bg);
    border: 1px solid var(--border-dark);
    border-radius: 0.375rem;
    padding: 0.5rem 2rem 0.5rem 2.25rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--giallo-roma);
    box-shadow: 0 0 0 2px rgba(255, 218, 97, 0.2);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.clear-search-btn {
    position: absolute;
    right: 0.5rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
    font-size: 0.75rem;
}

.clear-search-btn:hover {
    color: var(--text-primary);
    background-color: var(--border-dark);
}

.search-options {
    margin-top: 0.5rem;
}

.search-checkbox {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.search-checkbox input[type="checkbox"] {
    appearance: none;
    width: 0.875rem;
    height: 0.875rem;
    background-color: var(--card-bg);
    border: 1px solid var(--border-dark);
    border-radius: 0.125rem;
    margin-right: 0.375rem;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-checkbox input[type="checkbox"]:checked {
    background-color: var(--giallo-roma);
    border-color: var(--giallo-roma);
}

.search-checkbox input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    color: #000000;
    font-size: 0.625rem;
    font-weight: bold;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.search-checkbox:hover input[type="checkbox"] {
    border-color: var(--giallo-roma);
}

/* Highlights de busca */
.search-highlight {
    background-color: var(--giallo-roma);
    color: #000000;
    padding: 0.125rem 0.25rem;
    border-radius: 0.125rem;
    font-weight: 500;
}

.search-results-info {
    padding: 0.5rem 1rem;
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-dark);
    color: var(--text-muted);
    font-size: 0.75rem;
    text-align: center;
}

.no-search-results {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-muted);
}

.no-search-results i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--border-dark);
}

/* Lista de pastas */
.folder-item {
    display: flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    position: relative;
}

.folder-item:hover {
    background-color: #444444;
    color: var(--text-primary);
}

.folder-item.active {
    background-color: var(--giallo-roma);
    color: #000000;
}

.folder-item.active i {
    color: #000000 !important;
}

.folder-item.active .sidebar-section-count {
    color: #000000;
}

.folder-item i {
    color: var(--giallo-roma);
    margin-right: 0.5rem;
}

.folder-delete-btn {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
    opacity: 0.6;
    margin-left: auto;
}

.folder-delete-btn:hover {
    background-color: var(--rosso-roma);
    opacity: 1;
    transform: scale(1.1);
}

.folder-delete-btn i {
    color: var(--text-muted) !important;
    width: auto !important;
    margin: 0 !important;
    font-size: 0.75rem !important;
}

.folder-delete-btn:hover i {
    color: #FFFFFF !important;
}

.folder-item:hover .folder-delete-btn {
    opacity: 1;
}

/* All Notes Button */
.all-notes-item {
    background-color: var(--card-bg);
    border: 1px solid var(--border-dark);
    margin-bottom: 8px;
    font-weight: 500;
}

.all-notes-item:hover {
    background-color: #444444;
    border-color: var(--giallo-roma);
}

.all-notes-item.active {
    background-color: var(--giallo-roma);
    color: #000000;
    border-color: var(--giallo-roma);
}

.all-notes-item.active i {
    color: #000000 !important;
}

.all-notes-item.active .sidebar-section-count {
    color: #000000;
}

/* Lista de notas na sidebar (para mobile) */
.sidebar .notes-list {
    flex: 1;
    padding: 0 1rem;
    padding-bottom: 1rem;
    overflow-y: auto;
}

.note-item {
    padding: 0.75rem;
    background-color: var(--card-bg);
    border-radius: 0.5rem;
    border: 1px solid var(--border-dark);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 0.5rem;
}

.note-item:hover {
    background-color: #444444;
    box-shadow: 0 4px 6px -1px rgba(255, 218, 97, 0.1);
    border-color: var(--giallo-roma);
}

.note-item.active {
    border-color: var(--giallo-roma);
    background-color: #444444;
}

.note-title {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.note-preview {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.note-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.note-folder-tag {
    background-color: var(--border-dark);
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.6875rem;
}

/* Área principal */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

/* Toolbar */
.toolbar {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-dark);
    gap: 1rem;
}

.toolbar-left {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Botão de menu mobile */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.125rem;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.mobile-menu-btn:hover {
    background-color: var(--border-dark);
    color: var(--giallo-roma);
}

.mobile-notes-btn {
    margin-left: 0.5rem;
}

.mobile-back-btn {
    display: none;
    padding: 0.375rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
    margin-right: 0.5rem;
}

.mobile-back-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* Overlay da sidebar mobile */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 40;
    display: none;
}

/* Overlay do painel de notas mobile */
.notes-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 35;
    display: none;
}

.notes-overlay.show {
    display: block;
}

@media (max-width: 1024px) {
    .notes-panel {
        width: 16rem;
    }
}

/* Regras mobile consolidadas serão aplicadas abaixo */

.toolbar-center {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.note-title-input {
    font-size: 1.125rem;
    font-weight: 500;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    flex: 1;
}

.note-title-input::placeholder {
    color: var(--text-muted);
}

.folder-select {
    font-size: 0.875rem;
    border: 1px solid var(--border-dark);
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
    background-color: var(--secondary-gray);
    color: var(--text-primary);
}

/* Toolbar de formatação */
.format-toolbar {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-dark);
    padding: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.format-btn {
    padding: 0.5rem;
    border-radius: 0.25rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.format-btn:hover {
    background-color: #444444;
    color: var(--text-primary);
}

.format-btn.active {
    background-color: var(--giallo-roma);
    color: #000000;
}

.format-divider {
    border-left: 1px solid var(--border-dark);
    height: 1.5rem;
    margin: 0 0.5rem;
}

.font-size-select {
    font-size: 0.875rem;
    border: 1px solid var(--border-dark);
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
    background-color: var(--secondary-gray);
    color: var(--text-primary);
}

/* Editor */
.editor-container {
    flex: 1;
    padding: 1.5rem;
    background-color: var(--main-bg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.editor {
    width: 100%;
    flex: 1;
    background-color: var(--card-bg);
    border-radius: 0.5rem;
    border: 1px solid var(--border-dark);
    padding: 1.5rem;
    outline: none;
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 14px;
    resize: none;
    overflow-y: auto;
    min-height: 0;
}

.editor:focus {
    border-color: var(--giallo-roma);
    box-shadow: 0 0 0 2px rgba(255, 218, 97, 0.1);
}

.editor[contenteditable="true"]:empty:before {
    content: "Comece a escrever sua nota...";
    color: var(--text-muted);
    font-style: italic;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.modal-content {
    background-color: var(--card-bg);
    border-radius: 0.5rem;
    padding: 1.5rem;
    width: 24rem;
    border: 1px solid var(--border-dark);
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.modal-input {
    width: 100%;
    border: 1px solid var(--border-dark);
    border-radius: 0.25rem;
    padding: 0.75rem;
    margin-bottom: 1rem;
    outline: none;
    background-color: var(--secondary-gray);
    color: var(--text-primary);
}

.modal-input:focus {
    border-color: var(--giallo-roma);
}

.modal-input::placeholder {
    color: var(--text-muted);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.btn-cancel {
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel:hover {
    background-color: #444444;
    color: var(--text-primary);
}

.btn-confirm {
    padding: 0.5rem 1rem;
    background-color: var(--giallo-roma);
    color: #000000;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-confirm:hover {
    background-color: #EAB308;
}

/* Delete confirmation modal styles */
.modal-content .fas.fa-exclamation-triangle {
    color: var(--rosso-roma) !important;
}

.text-red-500 {
    color: #ef4444 !important;
}

.modal-message {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
    font-size: 0.95rem;
}

/* Toast notifications */
.toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
    color: var(--text-primary);
    z-index: 50;
    min-width: 250px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

.toast.success {
    background-color: var(--giallo-roma);
    color: #000000;
}

.toast.error {
    background-color: var(--rosso-roma);
}

/* Esconder scrollbar personalizada */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background-color: var(--sidebar-bg);
}

::-webkit-scrollbar-thumb {
    background-color: var(--border-dark);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-muted);
}

/* Statistics Bar */
.stats-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--sidebar-bg);
    border-top: 1px solid var(--border-dark);
    font-size: 0.75rem;
    color: var(--text-muted);
    min-height: 2.5rem;
    flex-shrink: 0; /* Impede que a barra seja comprimida */
}

.stats-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stats-item i {
    font-size: 0.625rem;
    color: var(--giallo-roma);
    width: 12px;
    text-align: center;
}

.stats-item span {
    font-weight: 500;
}

.stats-label {
    color: var(--text-muted);
    font-weight: 400 !important;
}

@media (max-width: 768px) {
    .stats-bar {
        gap: 1rem;
        padding: 0.375rem 0.5rem;
        font-size: 0.6875rem;
    }
    
    .stats-item {
        gap: 0.1875rem;
    }
    
    .stats-item i {
        font-size: 0.5625rem;
        width: 10px;
    }
}

/* Status Indicator */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.status-indicator.saving {
    background-color: rgba(255, 218, 97, 0.1);
    color: var(--giallo-roma);
    border: 1px solid rgba(255, 218, 97, 0.3);
}

.status-indicator.saved {
    background-color: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-indicator.unsaved {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-indicator.error {
    background-color: rgba(165, 42, 42, 0.1);
    color: var(--rosso-roma);
    border: 1px solid rgba(165, 42, 42, 0.3);
}

#statusIcon {
    font-size: 0.75rem;
}

#statusIcon.fa-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.status-indicator.saving #statusIcon {
    color: var(--giallo-roma);
}

.status-indicator.saved #statusIcon {
    color: #22c55e;
}

.status-indicator.unsaved #statusIcon {
    color: #ef4444;
}

.status-indicator.error #statusIcon {
    color: var(--rosso-roma);
}

/* Responsividade */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden; /* Evita scroll horizontal */
        overflow-y: auto; /* Permite rolagem vertical no mobile */
    }
    
    .main-container {
        display: block; /* Mudança importante para mobile */
        min-height: 100vh; /* Garante altura mínima */
        position: relative;
    }
    
    /* Sidebar mobile */
    .sidebar {
        width: 280px;
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 50;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    /* Notes panel mobile */
    .notes-panel {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 40;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 280px;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    }
    
    .notes-panel.mobile-open {
        transform: translateX(0);
    }
    
    /* Main content sempre visível */
    .main-content {
        width: 100%;
        min-height: 100vh;
        display: flex !important;
        flex-direction: column;
        margin-left: 0;
        position: static;
        z-index: 1;
        background-color: var(--main-bg);
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .mobile-back-btn {
        display: inline-flex;
    }
    
    .toolbar {
        flex-shrink: 0;
    }
    
    .toolbar-left {
        justify-content: flex-start;
    }
    
    .toolbar-right {
        gap: 0.25rem;
    }
    
    .btn-save,
    .btn-delete {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .editor-container {
        flex: 1;
        padding: 0.75rem;
        min-height: 0;
    }
    
    .editor {
        padding: 1rem;
        font-size: 16px; /* Evita zoom automático no iOS */
        min-height: 300px;
    }
    
    .stats-bar {
        flex-shrink: 0;
        position: sticky;
        bottom: 0;
    }
}

/* Ajustes para telas muito pequenas */
@media (max-width: 480px) {
    .mobile-menu-btn {
        padding: 0.375rem;
        font-size: 1rem;
    }
    
    .note-title-input {
        font-size: 1rem;
    }
    
    .toolbar-right {
        flex-wrap: wrap;
    }
    
    .format-toolbar {
        padding: 0.375rem;
        gap: 0.25rem;
        flex-wrap: wrap;
    }
    
    .format-btn {
        padding: 0.375rem;
        font-size: 0.75rem;
    }
    
    .stats-bar {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.375rem 0.5rem;
        min-height: auto;
    }
    
    .stats-item {
        min-width: 0;
        flex: 1;
        justify-content: center;
        font-size: 0.6875rem;
    }
    
    .editor-container {
        padding: 0.5rem;
    }
    
    .editor {
        padding: 0.75rem;
        min-height: 250px;
    }
    
    .sidebar {
        width: 260px;
    }
}

/* Utilities adicionais */
.hidden { display: none; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-4 > * + * { margin-left: 1rem; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.h-screen { height: 100vh; }
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }
.transition-colors { transition: color 0.15s ease-out, background-color 0.15s ease-out; }
.transition-shadow { transition: box-shadow 0.15s ease-out; }
.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.border { border-width: 1px; }
.border-b { border-bottom-width: 1px; }
.border-l { border-left-width: 1px; }
.border-r { border-right-width: 1px; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.pb-2 { padding-bottom: 0.5rem; }
.pb-4 { padding-bottom: 1rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mr-1 { margin-right: 0.25rem; }
.mr-2 { margin-right: 0.5rem; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.025em; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cursor-pointer { cursor: pointer; }

/* ========================================
   SISTEMA DE TAGS - ETAPA 6
   ======================================== */

/* Botões relacionados a tags */
.btn-tags {
    background-color: #8B5CF6;
    color: var(--text-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-weight: 500;
}

.btn-tags:hover {
    background-color: #7C3AED;
}

#newTagBtn {
    background: none !important;
    border: none !important;
    padding: 0.25rem !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

#newTagBtn i {
    color: #FFFFFF !important;
    font-size: 0.75rem;
    font-weight: normal;
}

#newTagBtn:hover i {
    color: #8B5CF6 !important;
}

/* Tags na sidebar */
.tag-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    margin-bottom: 0.25rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: transparent;
    border: 1px solid transparent;
}

.tag-item:hover {
    background-color: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.3);
}

.tag-item.active {
    background-color: rgba(139, 92, 246, 0.2);
    border-color: #8B5CF6;
}

.tag-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.tag-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.tag-name {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
}

.tag-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

.tag-delete-btn {
    opacity: 0;
    background: none;
    border: none;
    color: var(--rosso-roma);
    padding: 0.25rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.tag-delete-btn:hover {
    background-color: rgba(165, 42, 42, 0.2);
    color: #DC2626;
}

.tag-delete-btn i {
    font-size: 0.75rem;
}

.tag-delete-btn:hover i {
    color: #DC2626 !important;
}

.tag-item:hover .tag-delete-btn {
    opacity: 1;
}

/* Badges de tags */
.tag-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    color: white;
    margin: 0.125rem;
    position: relative;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.tag-badge.removable {
    padding-right: 1.5rem;
    cursor: pointer;
}

.tag-badge .remove-tag {
    position: absolute;
    right: 0.25rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.tag-badge .remove-tag:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Tags nas notas */
.note-tags {
    display: flex;
    flex-wrap: wrap;
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
}

.note-tags .tag-badge {
    margin: 0.125rem 0.125rem 0.125rem 0;
}

/* Modais de tags */
.modal-wide {
    max-width: 600px;
    width: 90vw;
}

.modal-form {
    margin: 1rem 0;
}

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.color-picker-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.color-picker {
    width: 50px;
    height: 40px;
    border: 1px solid var(--border-dark);
    border-radius: 0.25rem;
    background: none;
    cursor: pointer;
}

.color-preview {
    display: flex;
    align-items: center;
}

/* Grid de tags disponíveis */
.tags-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-dark);
    border-radius: 0.25rem;
    padding: 0.75rem;
    background-color: rgba(51, 51, 51, 0.3);
}

.tag-option {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    background-color: rgba(51, 51, 51, 0.5);
}

.tag-option:hover {
    background-color: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.3);
}

.tag-option.selected {
    background-color: rgba(139, 92, 246, 0.2);
    border-color: #8B5CF6;
}

.tag-option .tag-color {
    margin-right: 0.5rem;
}

.tag-option .tag-name {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Lista de tags da nota */
.tags-list {
    min-height: 50px;
    border: 1px solid var(--border-dark);
    border-radius: 0.25rem;
    padding: 0.75rem;
    background-color: rgba(51, 51, 51, 0.3);
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    align-content: flex-start;
}

.tags-list.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.875rem;
}

/* Estados especiais */
.tag-item.filtered {
    background-color: rgba(139, 92, 246, 0.2);
    border-color: #8B5CF6;
}

/* Responsividade para tags */
@media (max-width: 768px) {
    .btn-tags {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .tag-badge {
        font-size: 0.625rem;
        padding: 0.125rem 0.375rem;
    }
    
    .tags-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.25rem;
    }
    
    .modal-wide {
        width: 95vw;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .tag-item {
        padding: 0.375rem;
    }
    
    .tag-name {
        font-size: 0.75rem;
    }
    
    .tag-count {
        font-size: 0.625rem;
    }
    
    .tags-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ==============================
   IMAGE UPLOAD FUNCTIONALITY
   ============================== */

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border-dark);
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    background-color: var(--card-bg);
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.upload-area.drag-over {
    border-color: var(--giallo-roma);
    background-color: rgba(255, 218, 97, 0.1);
}

.upload-content {
    color: var(--text-secondary);
}

.upload-icon {
    font-size: 3rem;
    color: var(--giallo-roma);
    margin-bottom: 1rem;
}

.upload-content p {
    margin: 1rem 0;
    font-size: 1rem;
}

/* Progress Bar */
.upload-progress {
    margin-bottom: 1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: var(--border-dark);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background-color: var(--giallo-roma);
    width: 0%;
    transition: width 0.3s ease;
}

#progressText {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Images Grid */
.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.image-item {
    position: relative;
    border-radius: 0.5rem;
    overflow: hidden;
    background-color: var(--card-bg);
    border: 1px solid var(--border-dark);
    transition: all 0.3s ease;
    cursor: pointer;
    aspect-ratio: 1;
}

.image-item:hover {
    border-color: var(--giallo-roma);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 218, 97, 0.2);
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image-item .image-actions {
    position: absolute;
    top: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 0.25rem;
    border-radius: 0 0.5rem 0 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-item:hover .image-actions {
    opacity: 1;
}

.image-item .action-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.25rem;
    margin: 0 0.125rem;
    border-radius: 0.25rem;
    transition: all 0.3s ease;
}

.image-item .action-btn:hover {
    background-color: var(--giallo-roma);
    color: #000000;
}

.image-item .action-btn.delete:hover {
    background-color: var(--rosso-roma);
    color: var(--text-primary);
}

.image-item .image-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: var(--text-primary);
    padding: 0.5rem;
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-item:hover .image-info {
    opacity: 1;
}

/* Image insertion styles in editor */
.editor img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 0.5rem 0;
    border: 1px solid var(--border-dark);
    cursor: pointer;
    transition: all 0.3s ease;
}

.editor img:hover {
    border-color: var(--giallo-roma);
    box-shadow: 0 2px 8px rgba(255, 218, 97, 0.3);
}

.editor img.resizing {
    border-color: var(--giallo-roma);
    box-shadow: 0 0 0 2px rgba(255, 218, 97, 0.5);
}

/* Image resize handles */
.image-resize-handle {
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: var(--giallo-roma);
    border: 1px solid #000000;
    border-radius: 50%;
    cursor: nw-resize;
}

/* Toast notifications for images */
.toast.image-upload {
    background-color: var(--giallo-roma);
    color: #000000;
    border-left: 4px solid #EAB308;
}

.toast.image-error {
    background-color: var(--rosso-roma);
    color: var(--text-primary);
    border-left: 4px solid #DC2626;
}

/* Drag and drop styles for editor */
.editor.drag-over {
    border: 2px dashed var(--giallo-roma);
    background-color: rgba(255, 218, 97, 0.05);
}

/* Link styles in editor */
.editor a {
    color: var(--giallo-roma);
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.3s ease;
}

.editor a:hover {
    color: #EAB308;
    text-decoration: underline;
}

/* Auto-link detection highlight */
.auto-link-detected {
    background-color: rgba(255, 218, 97, 0.2);
    border-radius: 0.25rem;
    padding: 0 0.25rem;
}

/* Responsive adjustments for images */
@media (max-width: 768px) {
    .images-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.75rem;
    }
    
    .upload-area {
        padding: 1.5rem;
    }
    
    .upload-icon {
        font-size: 2rem;
    }
    
    .upload-content p {
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .images-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.5rem;
    }
    
    .upload-area {
        padding: 1rem;
    }
    
    .modal-wide {
        width: 95%;
        max-width: none;
    }
}

/* ==============================
   UPLOAD INFO STYLES
   ============================== */

.upload-info {
    background: rgba(255, 218, 97, 0.1);
    border: 1px solid rgba(255, 218, 97, 0.3);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.upload-info i {
    color: var(--giallo-roma);
    font-size: 0.9rem;
}

.upload-info strong {
    color: var(--giallo-roma);
    font-weight: 600;
}

/* ==============================
   MODAL TABS FOR IMAGE INSERTION
   ============================== */

/* Modal Tabs */
.modal-tabs {
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-dark);
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-btn:hover {
    color: var(--text-primary);
    background-color: rgba(255, 218, 97, 0.1);
}

.tab-btn.active {
    color: var(--giallo-roma);
    border-bottom-color: var(--giallo-roma);
    background-color: rgba(255, 218, 97, 0.1);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Small Upload Area for Modal */
.upload-area-small {
    border: 2px dashed var(--border-dark);
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
    background-color: var(--card-bg);
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.upload-area-small.drag-over {
    border-color: var(--giallo-roma);
    background-color: rgba(255, 218, 97, 0.1);
}

.upload-area-small .upload-icon {
    font-size: 2rem;
    color: var(--giallo-roma);
    margin-bottom: 0.5rem;
}

.upload-area-small .upload-content p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Tab responsive design */
@media (max-width: 480px) {
    .modal-tabs {
        flex-direction: column;
        border-bottom: none;
    }
    
    .tab-btn {
        padding: 0.5rem 1rem;
        border-bottom: 1px solid var(--border-dark);
        border-radius: 0;
    }
    
    .tab-btn.active {
        border-bottom-color: var(--giallo-roma);
        border-left: 3px solid var(--giallo-roma);
    }
    
    .upload-area-small {
        padding: 1rem;
    }
    
    .upload-area-small .upload-icon {
        font-size: 1.5rem;
    }
}

/* ==============================
   PWA SPECIFIC STYLES
   ============================== */

/* Estilos para quando o app está rodando em modo standalone (PWA instalada) */
.pwa-standalone {
    /* Adicionar padding superior para compensar status bar no mobile */
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* Ajustes para a toolbar em modo PWA */
.pwa-standalone .toolbar {
    padding-top: calc(0.75rem + env(safe-area-inset-top));
}

/* Otimizações touch para PWA */
.pwa-standalone .btn-primary,
.pwa-standalone .btn-save,
.pwa-standalone .btn-delete,
.pwa-standalone .btn-tags {
    min-height: 44px; /* Tamanho mínimo para touch targets iOS */
    touch-action: manipulation; /* Evita zoom duplo no touch */
}

/* Melhorias para gestos em PWA */
.pwa-standalone .main-container {
    overscroll-behavior: contain; /* Evita bounce scroll */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling iOS */
}

/* Estilos para splash screen personalizada */
@media (display-mode: standalone) {
    body {
        background-color: var(--main-bg);
    }
    
    /* Ocultar elementos que não fazem sentido em PWA */
    .browser-only {
        display: none !important;
    }
    
    /* Ajustar layout para tela cheia */
    .main-container {
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height para mobile */
    }
}

/* Indicador de status offline/online para PWA */
.pwa-status {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--rosso-roma);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.pwa-status.online {
    background: var(--giallo-roma);
    color: #000000;
}

.pwa-status.show {
    opacity: 1;
}

/* Estilos para notificações PWA personalizadas */
.pwa-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--sidebar-bg);
    border: 1px solid var(--border-dark);
    border-radius: 8px;
    padding: 16px;
    max-width: 300px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.pwa-notification.show {
    transform: translateX(0);
}

.pwa-notification-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.pwa-notification-icon {
    color: var(--giallo-roma);
    margin-right: 8px;
    font-size: 1.1rem;
}

.pwa-notification-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.pwa-notification-body {
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.4;
    margin-bottom: 12px;
}

.pwa-notification-actions {
    display: flex;
    gap: 8px;
}

.pwa-notification-btn {
    background: var(--giallo-roma);
    color: #000000;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.pwa-notification-btn:hover {
    background: #EAB308;
}

.pwa-notification-btn.secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-dark);
}

.pwa-notification-btn.secondary:hover {
    background: var(--border-dark);
    color: var(--text-primary);
}

/* Ajustes responsivos para PWA */
@media (max-width: 768px) {
    .pwa-notification {
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100%);
    }
    
    .pwa-notification.show {
        transform: translateY(0);
    }
    
    .pwa-status {
        top: env(safe-area-inset-top, 10px);
    }
}

/* Melhorias de performance para PWA */
.pwa-standalone .editor {
    will-change: contents; /* Otimização para rendering */
}

.pwa-standalone .sidebar,
.pwa-standalone .notes-panel {
    transform: translateZ(0); /* Força aceleração por hardware */
}

/* Dark mode específico para PWA (respeitando preferência do sistema) */
@media (prefers-color-scheme: dark) {
    .pwa-standalone {
        /* PWA já usa tema escuro por padrão, mantém consistência */
        color-scheme: dark;
    }
}

/* Estilos para telas de alta densidade (Retina) */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .pwa-standalone .sidebar-title i,
    .pwa-standalone .btn-primary i {
        /* Ícones mais nítidos em telas Retina */
        transform: translateZ(0);
        backface-visibility: hidden;
    }
}

/* Suporte para landscape em tablets */
@media (orientation: landscape) and (min-width: 768px) and (max-width: 1024px) {
    .pwa-standalone .sidebar {
        width: 10rem; /* Sidebar mais estreita em landscape */
    }
    
    .pwa-standalone .notes-panel {
        width: 18rem; /* Panel de notas mais estreito */
    }
}

/* Animações otimizadas para PWA */
@media (prefers-reduced-motion: no-preference) {
    .pwa-standalone .note-item,
    .pwa-standalone .folder-item,
    .pwa-standalone .tag-item {
        transition: transform 0.2s ease, background-color 0.2s ease;
    }
    
    .pwa-standalone .note-item:active,
    .pwa-standalone .folder-item:active,
    .pwa-standalone .tag-item:active {
        transform: scale(0.98); /* Feedback visual no touch */
    }
}

/* Estilos para quando há atualizações disponíveis */
.pwa-update-available {
    position: relative;
}

.pwa-update-available::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: var(--giallo-roma);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
} 