/* ===== CONTEXT MENU OVERLAY ===== */
.context-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 900;
    display: none;
}

.context-overlay.active {
    display: block;
}

/* ===== CONTEXT MODAL CONTAINER ===== */
.context-modal {
    position: fixed;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    display: none;
    width: 320px;
    max-height: 80vh;
    padding: 0;
    animation: contextSlideIn 0.2s ease;
}

.context-modal.active {
    display: block;
}

@keyframes contextSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== CONTEXT MODAL HEADER ===== */
.context-modal-header {
    padding: 12px 16px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9f9f9;
    border-radius: 8px 8px 0 0;
}

.context-modal-title {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.context-modal-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.context-modal-close:hover {
    background: rgba(33, 150, 243, 0.12);
    color: #1976d2;
    border-radius: 4px;
    box-shadow: 0 0 0 1px rgba(33, 150, 243, 0.25);
}

/* ===== CONTEXT MODAL BODY ===== */
.context-modal-body {
    padding: 12px;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Scrollbar customizada para Webkit (Chrome, Safari, Edge) */
.context-modal-body::-webkit-scrollbar {
    width: 8px;
}

.context-modal-body::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.context-modal-body::-webkit-scrollbar-thumb {
    background: #2196f3;
    border-radius: 4px;
}

.context-modal-body::-webkit-scrollbar-thumb:hover {
    background: #1976d2;
}

/* ===== CONTEXT MODAL ITEM ===== */
.context-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
    background: white;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
}

.context-item:hover {
    background: #f5f5f5;
    border-color: #2196f3;
}

.context-item.active {
    background: #e3f2fd;
    border-color: #2196f3;
}

.context-item-label {
    font-size: 11px;
    font-weight: 600;
    color: #2196f3;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.context-item-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 12px;
    font-family: 'Courier New', monospace;
}

.context-item-input:focus {
    outline: none;
    border-color: #2196f3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

/* ===== CONTEXT ITEM: CHECKBOXES ===== */
.context-item-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    cursor: pointer;
    user-select: none;
}

.context-item-checkbox input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: #2196f3;
    margin: 0;
}

.context-item-checkbox label {
    cursor: pointer;
    margin: 0;
}

/* ===== CONTEXT ITEM: ESTADO INICIAL ===== */
.context-item-initial {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px;
    background: #e8f5e9;
    border: 1px solid #4caf50;
    border-radius: 3px;
    font-size: 12px;
    color: #2e7d32;
    font-weight: 500;
}

.context-item-initial::before {
    content: '→';
    font-size: 14px;
    font-weight: bold;
}

/* ===== CONTEXT ITEM: ESTADO ACEITAÇÃO ===== */
.context-item-accept {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px;
    background: #e1f5fe;
    border: 1px solid #0288d1;
    border-radius: 3px;
    font-size: 12px;
    color: #01579b;
    font-weight: 500;
}

.context-item-accept::before {
    content: '◯◯';
    font-size: 12px;
    font-weight: bold;
}

/* ===== CONTEXT MODAL FOOTER ===== */
.context-modal-footer {
    padding: 12px;
    background: #f9f9f9;
    border-top: 1px solid #e0e0e0;
    border-radius: 0 0 8px 8px;
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.context-modal-footer .btn {
    font-size: 11px;
    padding: 8px 12px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.context-modal-footer .btn.primary {
    background: #2196f3;
    color: white;
}

.context-modal-footer .btn.primary:hover {
    background: #1976d2;
    box-shadow: 0 2px 6px rgba(33, 150, 243, 0.3);
}

.context-modal-footer .btn.secondary {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ccc;
}

.context-modal-footer .btn.secondary:hover {
    background: #e8e8e8;
}

.context-modal-footer .btn.danger {
    background: #f44336;
    color: white;
}

.context-modal-footer .btn.danger:hover {
    background: #d32f2f;
    box-shadow: 0 2px 6px rgba(244, 67, 54, 0.3);
}

/* ===== CONTEXT MODAL DIVIDER ===== */
.context-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 2px 0;
}

/* ===== CONTEXT MODAL SECTION ===== */
.context-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid #f0f0f0;
}

.context-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.context-section-title {
    font-size: 10px;
    font-weight: 600;
    color: #2196f3;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 4px 0;
}

/* ===== CONTEXT ACTIONS ===== */
.context-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.context-action-btn {
    padding: 8px 12px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 12px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

.context-action-btn:hover {
    background: #f5f5f5;
    border-color: #2196f3;
    color: #2196f3;
}

.context-action-btn.danger:hover {
    background: #ffebee;
    border-color: #f44336;
    color: #f44336;
}

.context-action-btn.success:hover {
    background: #e8f5e9;
    border-color: #4caf50;
    color: #4caf50;
}

.context-action-icon {
    font-size: 14px;
    min-width: 16px;
    text-align: center;
}

/* ===== ESTADO SELECIONADO INFO ===== */
.context-selected-info {
    padding: 10px;
    background: #e3f2fd;
    border-left: 3px solid #2196f3;
    border-radius: 3px;
    font-size: 11px;
    color: #2196f3;
    line-height: 1.5;
    display: none;
}

.context-selected-info.show {
    display: block;
}

.context-selected-info strong {
    display: block;
    margin-bottom: 4px;
}

/* ===== SCROLL NO BODY DO MODAL ===== */
.context-modal-body::-webkit-scrollbar {
    width: 4px;
}

.context-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.context-modal-body::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

.context-modal-body::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* ===== VALIDAÇÃO NO MODAL ===== */
.context-item-input.error {
    border-color: #f44336;
    background: #ffebee;
}

.context-item-input.error:focus {
    box-shadow: 0 0 0 2px rgba(244, 67, 54, 0.1);
}

.context-item-input.success {
    border-color: #4caf50;
    background: #e8f5e9;
}

.context-item-input.success:focus {
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
}

.context-error-message {
    font-size: 10px;
    color: #f44336;
    margin-top: 2px;
}

/* ===== POSICIONAMENTO DO MODAL ===== */
.context-modal.top-left {
    top: auto;
    left: auto;
}

.context-modal.top-right {
    top: auto;
    right: auto;
}

.context-modal.bottom-left {
    bottom: auto;
    left: auto;
}

.context-modal.bottom-right {
    bottom: auto;
    right: auto;
}

/* ===== ANIMAÇÕES DE FEEDBACK ===== */
@keyframes contextShake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

.context-modal.shake {
    animation: contextShake 0.3s ease;
}

@keyframes contextBounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

.context-modal.bounce {
    animation: contextBounce 0.3s ease;
}

/* ===== RESPONSIVE - MOBILE ===== */
@media (max-width: 768px) {
    .context-modal {
        min-width: 90vw;
        max-width: 95vw;
        max-height: 80vh;
    }

    .context-modal-body {
        max-height: 60vh;
    }

    .context-modal-title {
        font-size: 13px;
    }

    .context-item-label {
        font-size: 10px;
    }

    .context-item-input {
        font-size: 12px;
        padding: 8px 10px;
    }

    .context-item {
        padding: 8px;
    }

    .context-action-btn {
        font-size: 12px;
        padding: 10px;
    }

    .context-modal-footer {
        flex-direction: column-reverse;
    }

    .context-modal-footer .btn {
        width: 100%;
        font-size: 12px;
        padding: 10px;
    }
}

/* ===== RESPONSIVE - SMALL MOBILE ===== */
@media (max-width: 480px) {
    .context-modal {
        min-width: 92vw;
        max-width: 98vw;
    }

    .context-modal-body {
        max-height: 50vh;
    }

    .context-modal-title {
        font-size: 12px;
    }

    .context-modal-header {
        padding: 10px 12px;
    }

    .context-modal-body {
        padding: 10px;
        gap: 6px;
    }

    .context-modal-footer {
        padding: 10px;
    }

    .context-item {
        padding: 6px;
    }

    .context-item-label {
        font-size: 9px;
    }

    .context-item-input {
        font-size: 11px;
        padding: 6px 8px;
    }

    .context-action-btn {
        font-size: 11px;
        padding: 8px;
        gap: 6px;
    }

    .context-action-icon {
        font-size: 12px;
    }
}

/* ===== DARK MODE (Futuro) ===== */
@media (prefers-color-scheme: dark) {
    .context-modal {
        background: #2d2d2d;
        color: #e0e0e0;
    }

    .context-modal-header {
        background: #1e1e1e;
        border-color: #404040;
    }

    .context-modal-title {
        color: #64b5f6;
    }

    .context-item {
        background: #3a3a3a;
        border-color: #404040;
    }

    .context-item:hover {
        background: #424242;
    }
}

/* ===== PRINT ===== */
@media print {
    .context-overlay,
    .context-modal {
        display: none !important;
    }
}

/* ===== TRANSITION MODAL ===== */
.transition-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.transition-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: none;
    width: 420px;
    max-height: 80vh;
    overflow: hidden;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -48%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.transition-modal-header {
    padding: 16px 20px;
    border-bottom: 2px solid #2196f3;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
}

.transition-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.transition-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: white;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.transition-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.transition-modal-body {
    padding: 20px;
    max-height: calc(80vh - 140px);
    overflow-y: auto;
}

.transition-info {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 16px;
}

.transition-section {
    margin-top: 16px;
}

.transition-section-title {
    font-weight: 600;
    font-size: 13px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.symbol-chips {
    min-height: 60px;
    padding: 12px;
    background: #fafafa;
    border: 2px dashed #e0e0e0;
    border-radius: 6px;
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
}

.no-symbols {
    width: 100%;
    text-align: center;
    color: #999;
    font-size: 13px;
    padding: 8px;
}

.symbol-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #2196f3;
    color: white;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 500;
    animation: chipSlideIn 0.2s ease;
}

.symbol-chip.epsilon {
    background: #9c27b0;
}

@keyframes chipSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.symbol-chip-text {
    font-family: 'Courier New', monospace;
    font-size: 15px;
}

.symbol-chip-remove {
    background: rgba(0, 0, 0, 0.2);
    border: none;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    transition: background 0.2s;
}

.symbol-chip-remove:hover {
    background: rgba(0, 0, 0, 0.4);
}

.symbol-input-group {
    display: flex;
    gap: 8px;
}

.symbol-input-group input {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.symbol-input-group input:focus {
    outline: none;
    border-color: #2196f3;
}

.symbol-input-group .btn {
    padding: 10px 16px;
    white-space: nowrap;
}

.transition-hint {
    margin-top: 12px;
    padding: 10px;
    background: #e3f2fd;
    border-left: 3px solid #2196f3;
    border-radius: 4px;
    font-size: 12px;
    color: #1976d2;
}

.transition-hint code {
    background: rgba(33, 150, 243, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
}

.transition-modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #fafafa;
}
