/**
 * =====================================================
 * ATLAS OUTPUT WINDOW - STYLES
 * =====================================================
 *
 * Estilos para la ventana de salida de respuestas médicas
 *
 * @project Doctores.cloud
 * @founder Rodolfo Gallegos L.
 * =====================================================
 */

/* Output Window Container */
.atlas-output-window {
    position: fixed;
    top: 80px; /* Debajo del header */
    right: -550px;
    width: 550px;
    height: calc(100vh - 100px); /* Espacio arriba y abajo */
    max-height: 900px;
    background: white;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.15);
    z-index: 1000; /* No muy alto para no tapar modales */
    display: flex;
    flex-direction: column;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px 0 0 12px;
    border: 1px solid #e5e7eb;
}

.atlas-output-window.open {
    right: 20px; /* Separado del borde derecho */
}

/* Overlay - OCULTO: No necesario, output window no debe bloquear la UI */
.atlas-output-overlay {
    display: none !important;
}

/* Header */
.output-header {
    background: linear-gradient(135deg, #1E40AF 0%, #3B82F6 100%);
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(30, 64, 175, 0.2);
}

.output-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.output-header-left i {
    font-size: 24px;
}

.output-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.output-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.output-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.output-close-btn i {
    font-size: 18px;
}

/* Content Area */
.output-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    background: #F9FAFB;
}

.output-content::-webkit-scrollbar {
    width: 8px;
}

.output-content::-webkit-scrollbar-track {
    background: #F3F4F6;
}

.output-content::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 4px;
}

.output-content::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

/* Placeholder */
.output-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #9CA3AF;
    text-align: center;
}

.output-placeholder i {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.output-placeholder p {
    margin: 8px 0;
    font-size: 16px;
}

.output-placeholder-subtitle {
    font-size: 14px !important;
    opacity: 0.7;
}

/* Medical Content Styles */
.medical-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    color: #374151; /* Gris oscuro para texto normal */
    line-height: 1.8;
}

.medical-content p {
    color: #374151;
    margin: 12px 0;
    line-height: 1.8;
}

.medical-content br {
    display: block;
    margin: 8px 0;
}

.medical-h1 {
    color: #1E40AF;
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid #1E40AF;
}

.medical-h2 {
    color: #3B82F6;
    font-size: 22px;
    font-weight: 700;
    margin-top: 30px;
    margin-bottom: 15px;
    padding-left: 10px;
    border-left: 4px solid #3B82F6;
}

.medical-h3 {
    color: #1E40AF;
    font-size: 18px;
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 12px;
}

.medical-content ul {
    margin: 15px 0;
    padding-left: 30px;
    list-style-type: disc;
    color: #374151;
}

.medical-content li {
    margin: 10px 0;
    line-height: 1.7;
    color: #374151;
    display: list-item;
}

.medical-content strong {
    color: #1E40AF;
    font-weight: 600;
}

.medical-content em {
    color: #6B7280;
    font-style: italic;
}

.check-icon {
    color: #10B981;
    font-size: 18px;
    margin-right: 5px;
}

.warning-icon {
    color: #F59E0B;
    font-size: 18px;
    margin-right: 5px;
}

.info-icon {
    color: #3B82F6;
    font-size: 18px;
    margin-right: 5px;
}

.lab-icon {
    color: #8B5CF6;
    font-size: 18px;
    margin-right: 5px;
}

/* Medical Links */
.medical-link {
    color: #2563EB;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.medical-link:hover {
    color: #1E40AF;
    border-bottom-color: #1E40AF;
}

/* Medical References */
.medical-reference {
    color: #3B82F6;
    font-weight: 700;
    font-size: 11px;
    cursor: help;
}

/* Medical Tables */
.medical-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.medical-table th {
    background: linear-gradient(135deg, #1E40AF 0%, #3B82F6 100%);
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

.medical-table td {
    padding: 12px;
    border-bottom: 1px solid #E5E7EB;
    color: #374151;
    font-size: 14px;
}

.medical-table tr:hover {
    background: #F9FAFB;
}

/* Blockquotes */
.medical-content blockquote {
    border-left: 4px solid #3B82F6;
    padding-left: 20px;
    margin: 20px 0;
    color: #6B7280;
    font-style: italic;
}

/* Code blocks */
.medical-content code {
    background: #F3F4F6;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #EF4444;
}

.medical-content pre {
    background: #1F2937;
    color: #F9FAFB;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
}

.medical-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

/* Action Buttons */
.output-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    padding: 20px;
    background: white;
    border-top: 1px solid #E5E7EB;
    max-height: 200px;
    overflow-y: auto;
}

.output-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
}

.output-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.output-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.output-btn:not(:disabled):active {
    transform: translateY(0);
}

.output-btn i {
    font-size: 16px;
}

/* Button Colors */
.output-btn-primary {
    background: linear-gradient(135deg, #1E40AF 0%, #3B82F6 100%);
}

.output-btn-success {
    background: linear-gradient(135deg, #059669 0%, #10B981 100%);
}

.output-btn-info {
    background: linear-gradient(135deg, #0891B2 0%, #06B6D4 100%);
}

.output-btn-whatsapp {
    background: linear-gradient(135deg, #128C7E 0%, #25D366 100%);
}

.output-btn-calendar {
    background: linear-gradient(135deg, #7C3AED 0%, #A78BFA 100%);
}

.output-btn-phone {
    background: linear-gradient(135deg, #DC2626 0%, #EF4444 100%);
}

.output-btn-patient {
    background: linear-gradient(135deg, #EA580C 0%, #F97316 100%);
}

.output-btn.success-flash {
    animation: successFlash 0.5s ease;
}

@keyframes successFlash {
    0%, 100% {
        background: linear-gradient(135deg, #059669 0%, #10B981 100%);
    }
    50% {
        background: linear-gradient(135deg, #10B981 0%, #34D399 100%);
    }
}

/* Footer / Metadata */
.output-footer {
    background: #F9FAFB;
    padding: 15px 25px;
    border-top: 1px solid #E5E7EB;
}

.output-metadata {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.metadata-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #6B7280;
}

.metadata-item i {
    color: #9CA3AF;
    font-size: 14px;
}

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

/* Responsive */
@media (max-width: 768px) {
    .atlas-output-window {
        width: 100%;
        right: -100%;
    }

    .atlas-output-window.open {
        right: 0;
    }

    .output-actions {
        grid-template-columns: 1fr;
    }

    .medical-h1 {
        font-size: 24px;
    }

    .medical-h2 {
        font-size: 20px;
    }

    .output-content {
        padding: 20px;
    }

    .medical-content {
        padding: 20px;
    }
}

/* Print Styles */
@media print {
    .atlas-output-window {
        position: static;
        width: 100%;
        height: auto;
        box-shadow: none;
    }

    .output-header,
    .output-actions,
    .output-footer {
        display: none;
    }

    .output-content {
        padding: 0;
        overflow: visible;
    }

    .medical-content {
        box-shadow: none;
        page-break-inside: avoid;
    }
}
