/**
 * Notes Manager CSS - Sistema conversacional de notas
 * UI estilo chat para conversa entre cliente e barbearia
 */

.notes-section {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
}

/* Versão compacta para modais de visualização */
.notes-section.notes-compact {
    margin: 15px 0;
    padding: 12px;
}

.notes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #2d4a3e;
}

.notes-compact .notes-header {
    margin-bottom: 10px;
    padding-bottom: 8px;
}

.notes-header label {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d4a3e;
    margin: 0;
}

.notes-compact .notes-header label {
    font-size: 0.95rem;
}

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

.btn-add-note {
    background: #2d4a3e;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.notes-compact .btn-add-note {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-add-note:hover {
    background: #1f3329;
}

.btn-add-note i {
    font-size: 0.85rem;
}

/* Menu de tipo de nota */
.note-type-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 10px 0;
    padding: 10px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.note-type-option {
    background: white;
    border: 1px solid #d0d0d0;
    padding: 12px 16px;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.notes-compact .note-type-option {
    padding: 10px 12px;
    font-size: 0.9rem;
}

.note-type-option:hover {
    background: #f5f5f5;
    border-color: #2d4a3e;
}

.note-type-option i {
    color: #2d4a3e;
    font-size: 1.1rem;
}

/* Container de conversa */
.notes-container {
    margin-top: 15px;
}

.notes-compact .notes-container {
    margin-top: 10px;
}

.notes-subsection-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #555;
    margin: 15px 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.notes-compact .notes-subsection-title {
    font-size: 0.85rem;
    margin: 10px 0 8px;
}

.notes-subsection-title i {
    color: #2d4a3e;
}

.notes-conversation {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

/* Conversa compacta para modal de visualização */
.notes-compact .notes-conversation {
    max-height: 200px;
    gap: 8px;
    padding: 8px;
}

.no-notes {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 20px;
}

.notes-compact .no-notes {
    padding: 15px;
    font-size: 0.9rem;
}

/* Mensagem individual */
.note-message {
    display: flex;
    flex-direction: column;
    max-width: 75%;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mensagem própria (direita, verde) */
.note-message.own-message {
    align-self: flex-end;
}

.note-message.own-message .note-message-body {
    background: linear-gradient(135deg, #2d4a3e 0%, #3d5a4e 100%);
    color: white;
    border-radius: 12px 12px 2px 12px;
}

/* Mensagem de outros (esquerda, cinza) */
.note-message.other-message {
    align-self: flex-start;
}

.note-message.other-message .note-message-body {
    background: #f0f0f0;
    color: #333;
    border-radius: 12px 12px 12px 2px;
}

.note-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    padding: 0 8px;
}

.notes-compact .note-message-header {
    margin-bottom: 3px;
    padding: 0 6px;
}

.note-author {
    font-weight: 600;
    font-size: 0.85rem;
    color: #2d4a3e;
}

.notes-compact .note-author {
    font-size: 0.75rem;
}

.note-timestamp {
    font-size: 0.75rem;
    color: #999;
}

.notes-compact .note-timestamp {
    font-size: 0.7rem;
}

.note-message-body {
    padding: 12px 16px;
    position: relative;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.notes-compact .note-message-body {
    padding: 8px 12px;
}

.note-message-body p {
    margin: 0;
    line-height: 1.5;
    word-wrap: break-word;
}

.notes-compact .note-message-body p {
    font-size: 0.9rem;
    line-height: 1.4;
}

.note-message-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.notes-compact .note-message-actions {
    margin-top: 6px;
    padding-top: 6px;
}

.own-message .note-message-actions {
    border-top-color: rgba(255,255,255,0.2);
}

.other-message .note-message-actions {
    border-top-color: rgba(0,0,0,0.1);
}

.btn-icon {
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    opacity: 0.7;
    transition: opacity 0.2s, background 0.2s;
}

.notes-compact .btn-icon {
    padding: 3px 6px;
    font-size: 0.8rem;
}

.btn-icon:hover {
    opacity: 1;
    background: rgba(0,0,0,0.1);
}

.own-message .btn-icon:hover {
    background: rgba(255,255,255,0.2);
}

/* Input de nova nota */
.note-input-wrapper {
    margin-top: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 2px solid #2d4a3e;
}

.notes-compact .note-input-wrapper {
    margin-top: 10px;
    padding: 12px;
}

.note-input-wrapper textarea {
    width: 100%;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    padding: 10px;
    font-size: 0.95rem;
    resize: vertical;
    font-family: inherit;
}

.notes-compact .note-input-wrapper textarea {
    padding: 8px;
    font-size: 0.9rem;
}

.note-input-wrapper textarea:focus {
    outline: none;
    border-color: #2d4a3e;
    box-shadow: 0 0 0 3px rgba(45, 74, 62, 0.1);
}

.note-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    justify-content: flex-end;
}

.notes-compact .note-actions {
    gap: 8px;
    margin-top: 8px;
}

.notes-compact .btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* Nota privada */
.note-private-box {
    background: #fff9e6;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 15px;
    position: relative;
    margin-top: 10px;
}

.notes-compact .note-private-box {
    padding: 10px;
    margin-top: 8px;
}

.note-private-box::before {
    content: '🔒';
    position: absolute;
    top: -12px;
    left: 15px;
    background: #fff9e6;
    padding: 0 8px;
    font-size: 1.2rem;
}

.notes-compact .note-private-box::before {
    font-size: 1rem;
    top: -10px;
}

.note-private-box p {
    margin: 0 0 10px;
    color: #333;
    line-height: 1.6;
}

.notes-compact .note-private-box p {
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 8px;
}

#privateNoteDisplay {
    min-height: 40px;
}

.notes-compact #privateNoteDisplay {
    min-height: 30px;
}

/* Scrollbar customizada */
.notes-conversation::-webkit-scrollbar {
    width: 8px;
}

.notes-compact .notes-conversation::-webkit-scrollbar {
    width: 6px;
}

.notes-conversation::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.notes-conversation::-webkit-scrollbar-thumb {
    background: #2d4a3e;
    border-radius: 4px;
}

.notes-conversation::-webkit-scrollbar-thumb:hover {
    background: #1f3329;
}

/* Responsive */
@media (max-width: 768px) {
    .notes-section {
        padding: 15px;
    }

    .note-message {
        max-width: 85%;
    }

    .note-message-body {
        padding: 10px 12px;
    }

    .notes-header label {
        font-size: 1rem;
    }

    .btn-add-note {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    .notes-conversation {
        max-height: 300px;
    }
    
    .notes-compact .notes-conversation {
        max-height: 150px;
    }
}

/* States */
.note-input-wrapper[style*="display: none"],
.note-type-menu[style*="display: none"],
.notes-container[style*="display: none"] {
    display: none !important;
}
