/* ================================================
   notepad.css - Sistema de Prontuários
   ================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background-color: #f5f7fa;
    color: #333;
    padding: 0;
}

/* ================================================
   HEADER TOPO
   ================================================ */
.top-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-title-main {
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logout-btn {
    background: rgba(255,255,255,0.2);
    border: 2px solid white;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.logout-btn:hover {
    background: white;
    color: #667eea;
}

/* ================================================
   LAYOUT CONTAINER
   ================================================ */
.container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    min-height: calc(100vh - 60px);
}

/* ================================================
   MODAL DE SENHA DE PASTA
   ================================================ */
.password-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.password-modal {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(50px); }
    to   { opacity: 1; transform: translateY(0); }
}

.password-modal-header {
    text-align: center;
    margin-bottom: 30px;
}

.lock-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.lock-icon i {
    font-size: 2rem;
    color: white;
}

.password-modal h2 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.password-modal p {
    color: #7f8c8d;
    line-height: 1.6;
}

.password-alert {
    padding: 15px;
    background: #e74c3c;
    color: white;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: shake 0.5s ease;
}

.password-success {
    padding: 15px;
    background: #2ecc71;
    color: white;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25%       { transform: translateX(-10px); }
    75%       { transform: translateX(10px); }
}

.password-input-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.password-input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.password-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.toggle-password-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #95a5a6;
    cursor: pointer;
    font-size: 1.2rem;
}

.toggle-password-btn:hover { color: #667eea; }

.password-actions {
    display: flex;
    gap: 10px;
}

.btn-password {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-password-submit {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-password-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-password-skip {
    background: #95a5a6;
    color: white;
}

.btn-password-skip:hover { background: #7f8c8d; }

.btn-password-danger {
    background: #e74c3c;
    color: white;
}

.btn-password-danger:hover { background: #c0392b; }

.first-time-info {
    background: linear-gradient(135deg, rgba(46,204,113,0.08), rgba(39,174,96,0.08));
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    color: #27ae60;
    font-size: 0.9rem;
}

/* ================================================
   SIDEBAR (PASTAS)
   ================================================ */
.sidebar {
    width: 280px;
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 20px 0;
    height: calc(100vh - 60px);
    position: sticky;
    top: 60px;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid #34495e;
    margin-bottom: 20px;
}

.sidebar-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.folder-list { list-style: none; }

.folder-item {
    padding: 12px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 6px;
    margin: 2px 10px;
    transition: all 0.2s ease;
}

.folder-item:hover { background-color: #34495e; }

.folder-item.active {
    background-color: #3498db;
    font-weight: 500;
}

.folder-name {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.folder-lock-icon {
    color: #f39c12;
    font-size: 0.9rem;
}

.folder-count {
    background-color: rgba(255,255,255,0.2);
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.8rem;
}

.add-folder-form {
    padding: 15px 20px;
    border-top: 1px solid #34495e;
    margin-top: 20px;
}

.folder-actions {
    display: flex;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.folder-item:hover .folder-actions { opacity: 1; }

.folder-action-btn {
    background: none;
    border: none;
    color: #ecf0f1;
    cursor: pointer;
    margin-left: 8px;
    font-size: 14px;
    opacity: 0.8;
    transition: all 0.2s;
}

.folder-action-btn:hover   { opacity: 1; }
.folder-action-btn.rename  { color: #3498db; }
.folder-action-btn.delete  { color: #e74c3c; }
.folder-action-btn.password{ color: #f39c12; }

/* ================================================
   CONTEÚDO PRINCIPAL
   ================================================ */
.main-content {
    flex: 1;
    padding: 20px;
    background-color: #f5f7fa;
    overflow-y: auto;
}

/* ================================================
   DASHBOARD
   ================================================ */
.dashboard {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    text-align: center;
}

.dashboard-header { margin-bottom: 3rem; }

.dashboard-title {
    font-size: 3rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.dashboard-subtitle {
    font-size: 1.2rem;
    color: #7f8c8d;
    margin-bottom: 2rem;
}

.dashboard-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    justify-content: center;
}

.stat-card {
    background: white;
    padding: 1.5rem 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: center;
    min-width: 150px;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #3498db;
    display: block;
}

.stat-label {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.dashboard-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 800px;
    width: 100%;
}

.action-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.action-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    text-decoration: none;
    color: inherit;
}

.action-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-icon.all {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.action-icon.new {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
}

.action-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.action-description {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.folders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    max-width: 1000px;
    width: 100%;
}

.folder-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 2px solid transparent;
}

.folder-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    text-decoration: none;
    color: inherit;
    border-color: #667eea;
}

.folder-card-icon {
    font-size: 3.5rem;
    color: #667eea;
    min-width: 80px;
    margin-bottom: 1rem;
    position: relative;
}

.folder-card-content { width: 100%; }

.folder-card-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.folder-card-count {
    color: #7f8c8d;
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

/* ================================================
   HEADER DA PASTA / NOTAS
   ================================================ */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px 30px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.header-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    align-items: center;
}

.header-title-text { margin-right: 10px; }

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.rename-btn {
    background: none;
    border: none;
    color: #3498db;
    cursor: pointer;
    font-size: 16px;
    opacity: 0.7;
    transition: all 0.2s;
    margin-left: 8px;
}

.rename-btn:hover { opacity: 1; }

.password-btn {
    background: none;
    border: none;
    color: #f39c12;
    cursor: pointer;
    font-size: 16px;
    opacity: 0.7;
    transition: all 0.2s;
    margin-left: 8px;
}

.password-btn:hover { opacity: 1; }

/* ================================================
   FORMULÁRIO DE NOTA
   ================================================ */
.note-form {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 30px;
    display: none;
}

.note-form.active { display: block; }

.form-group { margin-bottom: 20px; }

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
}

.input-field {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.input-field:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52,152,219,0.2);
}

.select-field {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    background-color: white;
    font-family: inherit;
}

/* ================================================
   ATALHOS RÁPIDOS
   ================================================ */
.atalhos-section {
    background: linear-gradient(135deg, rgba(102,126,234,0.05), rgba(118,75,162,0.05));
    border: 1px solid rgba(102,126,234,0.2);
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 20px;
}

.atalhos-section .form-label {
    font-size: 14px;
    color: #555;
    margin-bottom: 12px;
}

.atalhos-buttons-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    min-height: 36px;
}

.atalho-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.atalho-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102,126,234,0.4);
}

.atalho-btn:active { transform: scale(0.96); }

.atalho-btn .delete-atalho {
    margin-left: 4px;
    color: rgba(255,255,255,0.65);
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s;
}

.atalho-btn .delete-atalho:hover { color: #ffaaaa; }

.atalhos-add-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.atalhos-add-row .input-field {
    font-size: 13px;
    padding: 8px 12px;
}

.atalhos-add-row .input-nome  { flex: 1; min-width: 150px; }
.atalhos-add-row .input-texto { flex: 2; min-width: 200px; min-height: 58px; resize: vertical; }

.atalho-feedback {
    display: none;
    margin-top: 8px;
    padding: 8px 14px;
    background: #2ecc71;
    color: white;
    border-radius: 6px;
    font-size: 13px;
    align-items: center;
    gap: 8px;
}

/* ================================================
   GRID DE NOTAS
   ================================================ */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.note-card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid #eee;
}

.note-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-3px);
}

.note-header {
    padding: 15px 20px;
    border-bottom: 1px solid #f1f1f1;
    background-color: #fdfdfd;
}

.note-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #2c3e50;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.note-meta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #7f8c8d;
}

.note-folder {
    display: flex;
    align-items: center;
    gap: 5px;
}

.note-date { font-size: 12px; }

.note-preview {
    padding: 15px 20px;
    color: #666;
    flex: 1;
    overflow: hidden;
    position: relative;
    max-height: 100px;
}

.note-preview::after {
    content: "";
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 40px;
    background: linear-gradient(transparent, white);
}

.note-actions {
    display: flex;
    border-top: 1px solid #f1f1f1;
}

.note-btn {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: #7f8c8d;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.note-btn:hover          { background-color: #f8f9fa; }
.note-btn-view:hover     { color: #9b59b6; }
.note-btn-edit:hover     { color: #3498db; }
.note-btn-move:hover     { color: #2ecc71; }
.note-btn-delete:hover   { color: #e74c3c; }

/* ================================================
   BOTÕES GERAIS
   ================================================ */
.btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
}

.btn-primary   { background-color: #3498db; color: white; }
.btn-primary:hover { background-color: #2980b9; }

.btn-success   { background-color: #2ecc71; color: white; }
.btn-success:hover { background-color: #27ae60; }

.btn-danger    { background-color: #e74c3c; color: white; }
.btn-danger:hover  { background-color: #c0392b; }

.btn-secondary { background-color: #95a5a6; color: white; }
.btn-secondary:hover { background-color: #7f8c8d; }

.btn-warning   { background-color: #f39c12; color: white; }
.btn-warning:hover { background-color: #e67e22; }

/* ================================================
   MODAIS
   ================================================ */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
}

.modal-content {
    background-color: white;
    border-radius: 10px;
    max-width: 800px;
    width: 90%;
    position: relative;
    margin: 40px auto;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    animation: modalFadeIn 0.3s;
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #eee;
    position: relative;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
}

.modal-body {
    padding: 20px 30px;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 15px 30px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-close {
    position: absolute;
    top: 18px; right: 20px;
    font-size: 24px;
    color: #95a5a6;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

.modal-close:hover { color: #e74c3c; }

.note-content-preview {
    min-height: 300px;
    line-height: 1.6;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ================================================
   BUSCA
   ================================================ */
.search-container {
    position: relative;
    width: 300px;
}

.search-box {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-box:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52,152,219,0.2);
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #95a5a6;
}

/* ================================================
   MENSAGEM SEM NOTAS
   ================================================ */
.no-notes-message {
    text-align: center;
    padding: 40px;
    color: #95a5a6;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* ================================================
   RESPONSIVO
   ================================================ */
@media (max-width: 991px) {
    .container { flex-direction: column; }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        top: 0;
    }

    .folder-list {
        display: flex;
        flex-wrap: wrap;
        padding: 0 10px;
    }

    .folder-item { margin: 5px; }
    .add-folder-form { padding: 15px; }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .header-actions {
        width: 100%;
        flex-direction: column;
        gap: 10px;
    }

    .search-container { width: 100%; }
    .notes-grid { grid-template-columns: 1fr; }
    .dashboard-title { font-size: 2rem; }
    .dashboard-stats { gap: 1rem; }
    .dashboard-actions { grid-template-columns: 1fr; }
    .folders-grid { grid-template-columns: 1fr; }

    .top-header {
        flex-direction: column;
        gap: 10px;
    }

    .password-modal { padding: 30px 20px; }

    .atalhos-add-row { flex-direction: column; }
    .atalhos-add-row .input-nome,
    .atalhos-add-row .input-texto { width: 100%; }
}
